Adding to $PATH
by iicapn from LinuxQuestions.org on (#5JNZK)
I'm trying to download some software and add the bin folder to the PATH using a bash script. The version of the software updates periodically. Right now I have this:
Code:cd /tmp
wget https://example.com/app-62.3-x86_64-linux-gnu.tar.gz
tar -xvzf app*.gz
rm app*.gz
mv app* /opt
PATH=$PATH:/opt/app-62.3/binBut I'm getting hung up on the last line... I tried using a wildcard in the PATH, but that doesn't seem to work.
My next idea is to, after the untar line, read the exact directory name, then add that to the PATH, but I'm not sure how to do that.
Many thanks to all in advance :-)
Code:cd /tmp
wget https://example.com/app-62.3-x86_64-linux-gnu.tar.gz
tar -xvzf app*.gz
rm app*.gz
mv app* /opt
PATH=$PATH:/opt/app-62.3/binBut I'm getting hung up on the last line... I tried using a wildcard in the PATH, but that doesn't seem to work.
My next idea is to, after the untar line, read the exact directory name, then add that to the PATH, but I'm not sure how to do that.
Many thanks to all in advance :-)