[linux] bash vs command line

Günther Mittermayer g_mitter at web.de
Fri Sep 5 05:21:04 PDT 2003


Hi all..

I need to create a couple of enviroment variables everytime I need to run some application.
Instead of just typing the "exports" in the command line, I tryied creating a bash file to help me, but what seemed so simple is driving me crazy.

on the command line it works fine, but on a bash file not.. for example:

$> export VAR=50
$> echo $VAR

shows me the 50 with no problems... but if I do it in a bash file like that:

#!/usr/bash
VAR="50"
echo $VAR
export VAR

I run the script and it shows the 50 (because of the echo $VAR line), but again on the command line:
$> echo $VAR

won't give me anything, as if the variable simply isn't defined.....
I am confused... what am I doing wrong??

thanks for any ideas,

Günther.
______________________________________________________________________________
38xTestsieger - WEB.DE FreeMail - Deutschlands beste E-Mail
zum Patent angemeldetem 3-Wege-Spam-Schutz- http://f.web.de/?mc=021130



More information about the Linux mailing list