Knurpht, et al -- ...and then Knurpht @ openSUSE said... % % Op woensdag 16 mei 2018 15:19:58 CEST schreef Mark Misulich: % > On Wed, 2018-05-16 at 01:53 -0500, David C. Rankin wrote: ... % > > % > > [[ $PATH =~ /usr/local/bin ]] || export "${PATH}:/usr/local/bin" ... % > % > linux-2b8:/usr/local/bin # [[ $PATH =~ /usr/local/bin ]] || export % > "{PATH}:/usr/local/bin" % > bash: export: `{PATH}:/usr/local/bin': not a valid identifier % why not % export PATH=$PATH:/usr/local/bin; run_whatever_program % ? That's basically what David told him to do. Unfortunately, Mark left off the $ and so he suddenly wasn't really talking about a variable but instead a fixed string, which of course one cannot export. Now, the export "${PATH}:/usr/local/bin" doesn't quite look right to me, either, but since we didn't even get that far we don't have to worry about that :-) % The ~ in your statement makes it point to /root/usr/local/bin. Not quite... That was a match =~ operator, which basically says "is the string on the right matched anywhere in the string on the left?" a la echo | grep. I'm not a fan because it's a bash-ism and I'm generally a Bourne purist for portability, but it is indeed one of the fun things you can do in more advanced shells like bash or ksh. HTH & HAND :-D -- David T-G See http://justpickone.org/davidtg/email/ See http://justpickone.org/davidtg/tofu.txt -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org