I am trying to write a shell script which, when running, will set some environment variables that set the caller's Csh / In tcsh, or
export FOO = foo
Sitting FuFu
Set it only in sh / bash during execution of the script.
I already know that
source myscript
will execute script commands instead of launching a new shell, And this can be set to "collar" environments.
But this is to rub:
I want this script to be able to call either from bash or csh. In other words, I want that the shell user either Be able to run the script and change the environment of their shell. So 'source' will not work for me, because CSS running a user can not source a Bash script, and a user running Bash can not source a CST script.
Is there a proper solution in it, there is no need to write and maintain two versions on the script?
There is a copy of your shell process in the parent environment and in any way No access to the situation. When your shell process eliminates any changes made to your environment, sourcing a script file to configure shell environment is the most commonly used method, you can only use two types of tablet cutting and shell From each one you want to maintain.
Comments
Post a Comment