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

Re: Bash: testing a variable



On Fri, 9 Jul 2021 22:11:05 +0200
Joerg Kampmann <ibk-klima-vortrag@ibk-consult.de> wrote:

> > I call the script with the . operator: ". test.sh"  
> this is the result:
> 
> 
> root@primergy:~/software-env# . test.sh
> 
> Substr is /root/.local/bin/
> Substring NOT found.
> root@primergy:~/software-env#

OK, that's what I get if I don't have ~/.local/bin.

charles@white:~$ . test.sh
Substr is /home/charles/.local/bin/. $PATH is /home/charles/bin:/home/charles/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games.
Substring NOT found.
$PATH is /home/charles/bin:/home/charles/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games.
charles@white:~$ 

(I added the code to print out $PATH at the end.)

Now, is ~/.local/bin present on your computer? It is not present on
white, above. If not, what happens if you create it and then run
test.sh? (mkdir -p ~/.local/bin)?

-- 
Does anybody read signatures any more?

https://charlescurley.com
https://charlescurley.com/blog/


Reply to: