What is the best practice when using external utilities in shell scripts. For example, if I want to run "gzip" in several scripts, ensuring that a specific gzip binary is used, should I make the full path to the binary variable and just use the variable if not a script?
GZIP=/home/me/bin/gzip $GZIP somefile $GZIP anotherfile
Or is it better to practice hard code for each call for binary?
/home/me/bin/gzip somefile /home/me/bin/gzip anotherfile
Or is it better to install and rely on the path?
PATH=/home/me/bin:$PATH gzip somefile gzip anotherfile
I do not run scripts as root, so maintainability and portability are more important than user security.
Steve source share