PDA

View Full Version : bash variabel outside the script



Onbeperkt
March 6th, 2007, 05:08 PM
Hi guys,

I have a script that keep track of line counts in a certain file whenever i login to a terminal. The count is stored in a file with other data from the script.

i rather don't want this line count between my data. Is their a way so i could make an variabel on the system so i don't have to write it to a file.


kind regards,

Ramses de Norre
March 6th, 2007, 08:52 PM
You can export it, it will then be available to all subshells of the one the script runs in.
You can't make a variable accessible to supershells though...
To export a variable (eg var) you do:
export var