3 ms·
To be fair most of those newbies are probably writing scripts that use relative directories so they require them being run in the same directory. Newbies tend t
by eikenberry 4y ago
To be fair most of those newbies are probably writing scripts that use relative directories so they require them being run in the same directory. Newbies tend to reinforce bad habits like that which makes it harder to break out of those ruts.
- bradwood 4y ago(cd ./some/path; ./script.sh)
- eikenberry 4y agoIMO it's easier just to write your scripts so they don't rely on the directory context for running correctly. Usually it's just a matter of taking your relative path using script and sticking something like this at the top and you're good. cd "$(dirname $0)"