[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:34:57 +0100 |
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 ? =))
- small problem with BASH_SOURCE and PATH, Alex fxmbsw7 Ratchev, 2022/02/10
- Re: small problem with BASH_SOURCE and PATH,
Alex fxmbsw7 Ratchev <=
- Re: small problem with BASH_SOURCE and PATH, Alex fxmbsw7 Ratchev, 2022/02/10
- Re: small problem with BASH_SOURCE and PATH, Alex fxmbsw7 Ratchev, 2022/02/11
- Re: small problem with BASH_SOURCE and PATH, Greg Wooledge, 2022/02/11
- Re: small problem with BASH_SOURCE and PATH, Alex fxmbsw7 Ratchev, 2022/02/11
- Re: small problem with BASH_SOURCE and PATH, Alex fxmbsw7 Ratchev, 2022/02/11
- Re: small problem with BASH_SOURCE and PATH, Alex fxmbsw7 Ratchev, 2022/02/11
- Re: small problem with BASH_SOURCE and PATH, Alex fxmbsw7 Ratchev, 2022/02/11
- Re: small problem with BASH_SOURCE and PATH, Alex fxmbsw7 Ratchev, 2022/02/11
- Re: small problem with BASH_SOURCE and PATH, Dennis Williamson, 2022/02/11
- Re: small problem with BASH_SOURCE and PATH, Alex fxmbsw7 Ratchev, 2022/02/11