1

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?

1 Answer 1

0

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .