I am writing a script that installs a program. The problem is the program needs to have PATH variables set to install.
How do I set PATH variables during the script execution and update the shell so the installation can finish with one sweep?
You can try this :
#!/bin/bash PATH=$PATH:[path to add] [ shell program here ] [ e.g. sudo dpkg -i xyz.deb ]
This will add PATH variables to the system which will reset on closing of the terminal. To permanently change them, add the PATH=... line to .bashrc