how to export a variable when in xterm (in bash script in xterm)
Hello, I have now the luck to have a program to have Canoscan N650U run in Linux bur it is rudimentary (though working perfectly) and it has to be operated in console mode. Thus I made a Bash script to enter the variable and have the program run. I work with a xterm console because I use Gimp too thus I need to work in X. Problem with global variable. Impossiblee to export a variable and to recover it after a reboot (I would like to save the last scanned file). Does anybody know how to export and create a global variable in a xterm environment (!!!! if I export a variable with export LASTFILE in console mode thus not in X, impossible to recover it in X thus the global variables are saved in another config file in X but which one?). Somebody told of /home/user/.bash_profile but it does not exist in SuSE-7.3. Which file to use to define a global variable in a Bash shell. -- Alain Barthélemy cassandre@gminformatique.com bartydeux@gminformatique.com http://bartydeux.gminformatique.com
On Sat, 17 Aug 2002 13:26:56 +0200
Alain Barthélemy
Somebody told of /home/user/.bash_profile but it does not exist in SuSE-7.3. Which file to use to define a global variable in a Bash shell.
In your home directory look for the hidden file .bashrc Put a line in there like export EDITOR = /usr/bin/joe and now every NEW xterm will have that in it's environment variables. You can setup custom bashrc's too. Make a .bashrc1, and .bashrc2, (you can name the files anything you want). Then start an xterm, and it will have the variables from the default .bashrc. Now type "source .bashrc1". Now the xterm has the variables from .bashrc1, but only that xterm, and only until you kill off the xterm. If you just need to change an environmental variable in the current xterm: export EDITOR=/usr/bin/vim now the $EDITOR ,for that xterm only, is vim, until you kill off the xterm. -- use Perl; #powerful programmable prestidigitation
participants (2)
-
Alain Barthélemy
-
zentara