Wednesday, 14 August 2013

bash: setting environment variables from a script and leave a shell prompt

bash: setting environment variables from a script and leave a shell prompt

I'm looking for a way to create some kind of a 'setup' script that would
set environment variables and at the end leave the user with a bash
command prompt.
for example:
#!/bin/bash
export PATH=...
export LD_LIBRARY_PATH=...
export PS1=...
...
<give a shell prompt with the above environment variables set>
I don't want to source a file with the environment variable settings since
I'd like the user to be able to 'exit' back to the shell where this
'setup' was launched.
How can this be done?

No comments:

Post a Comment