0

Having to set a lot of paths on $PATH then wrote this code to load it from a text file:

  #!/bin/bash
  cd ~
  echo '#++++++' >> ./pathlstbkp
  cat ./pathlst >> ./pathlstbkp
  while read pth; do 
    cmd='export PATH="'$pth':$PATH"'
    eval ${cmd}
  done < ./pathlst
  echo '' > ./pathlst 

As you can see described here when using eval the evaluated command doesnt run on subshell.
But it dont change the $PATH variable.
Now realized someting strange happens, it dont work on my test Ubuntu-LTS18-Minimal-X64 but works on my main machine, a Debian9.

Mark
  • 91
  • 1
  • 9
  • I'm voting to close this question as off-topic because the poster fixed the problem by reinstallation, so it's unlikely that the reason for the issue will ever be found. – Jenny D Mar 22 '19 at 11:43

1 Answers1

0

I deleted the virtual machine and did the same again and it works, probably was something on evironment

Mark
  • 91
  • 1
  • 9