help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: small problem with BASH_SOURCE and PATH


From: Alex fxmbsw7 Ratchev
Subject: Re: small problem with BASH_SOURCE and PATH
Date: Thu, 10 Feb 2022 23:36:43 +0100

my=/tmp/$SRANDOM ; mkdir -p $my/bin ; cd $my ; printf 'yes | head -3'
>bin/ye ; printf >script %s\\n '#!/usr/bin/env -S
bash' 'PATH=$PATH:${BASH_SOURCE%/*}/bin' 'ye' ; chmod +x * */* ; bash
script ; ./script
script: line 3: ye: command not found
y
y
y

mailed this to try if formatting got removed
i saw it broken in the mail, sorry for overheat

or this

my=/tmp/$SRANDOM ; mkdir -p $my/bin ; cd $my ; printf 'yes | head -3'
> >bin/ye ; printf >script %s\\n '#!/usr/bin/env -S
> bash' 'PATH=$PATH:${BASH_SOURCE%/*}/bin' 'ye' ; chmod +x * */* ; bash
> script ; ./script
> script: line 3: ye: command not found
> y
> y
> y


On Thu, Feb 10, 2022 at 11:34 PM Alex fxmbsw7 Ratchev <fxmbsw7@gmail.com>
wrote:
>
> here is an example stating
> thanks greycat =))
>
> my=/tmp/$SRANDOM ; mkdir -p $my/bin ; cd $my ; printf 'yes | head -3'
> >bin/ye ; printf >script %s\\n '#!/usr/bin/env -S
> bash' 'PATH=$PATH:${BASH_SOURCE%/*}/bin' 'ye' ; chmod +x * */* ; bash
> script ; ./script
> script: line 3: ye: command not found
> y
> y
> y
>
> On Thu, Feb 10, 2022 at 9:56 PM Alex fxmbsw7 Ratchev <fxmbsw7@gmail.com>
wrote:
> >
> > so i have a project
> > resulting code contains PATH=$PATH:${BASH_SOURCE%/*}/bin
> >
> > so i have
> >
> > ./
> > ./script
> > ./bin/
> > ./bin/an.gawk
> >
> > ( small example )
> > when i run the script like ./script it works
> > if i run it via 'bash script' it says the gawk not found
> >
> > any help ? =))


reply via email to

[Prev in Thread] Current Thread [Next in Thread]