3 ms·
Most scripts I write cd into the directory they are located in for this reason. (and so that nohup.out files don't clobber each other in my home folder) Hopeful
by extraduder_ire 3y ago
Most scripts I write cd into the directory they are located in for this reason. (and so that nohup.out files don't clobber each other in my home folder) Hopefully I can keep this in mind if I ever have to symlink them.
- _ea1k 3y ago+1 - it really irritates me when some script insists that I change into its directory in order to work. Its just lazy script writing.
- twic 3y agoIt can also be annoying when a script changes directory itself. If anything the script does is relative to the current directory (interpreting a relative path, creating output files), you now can't have that be relative to your current working directory. Best practice, IMHO, is usually for scripts not to touch the current directory, and to be agnostic to it.