Hello, On Wed, 16 May 2018, Knurpht @ openSUSE wrote:
Op woensdag 16 mei 2018 15:19:58 CEST schreef Mark Misulich:
[[ $PATH =~ /usr/local/bin ]] || export "${PATH}:/usr/local/bin" [..]
On Wed, 2018-05-16 at 01:53 -0500, David C. Rankin wrote: [..] linux-2b8:/usr/local/bin # [[ $PATH =~ /usr/local/bin ]] || export "{PATH}:/usr/local/bin"
That should have been export PATH="$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 ? The ~ in your statement makes it point to /root/usr/local/bin.
RTFM. ==== man bash ==== [[ expression ]] [..] An additional binary operator, =~, is available, with the same precedence as == and !=. When it is used, the string to the right of the operator is considered an extended regular expres- sion and matched accordingly (as in regex(3)). The return value is 0 if the string matches the pattern, and 1 otherwise. ==== HTH, -dnh -- A mouse is a device used to focus xterms. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org