Passing variables from shell script to another
- From: Nezhate <mazouz.nezhate@xxxxxxxxx>
- Date: Mon, 31 Mar 2008 03:12:16 -0700 (PDT)
Hi all,
I've just started to learn shell programming. I have 2 scripts and
wont to pass some variables from script1 to script2
exp:
Script1 is:
#!/bin/sh
echo "Enter 3 data"
read tmp1 tmp2 tmp3
.. ./script2.sh $tmp1 $tmp2 $tmp3
exit 0
script2 is:
#!/bin/sh
tst_fct (){
var1=$1
var2=$2
var3=$3
echo "var1=$var1, var2=$var2, var3=$var3"
}
exit 0
as result I got:
$ ./script1.sh
Enter 3 data
foo bar nothing
var1=, var2=, var3=
why this doesn't work ?
thanks in advance
.
- Follow-Ups:
- Re: Passing variables from shell script to another
- From: Floyd L. Davidson
- Re: Passing variables from shell script to another
- From: Neil Cherry
- Re: Passing variables from shell script to another
- Prev by Date: 85th Gucci Ltd. Replica Handbags - Cheapest Fake 85th Gucci Ltd.
- Next by Date: Some "media keys" not detected by xev?
- Previous by thread: 85th Gucci Ltd. Replica Handbags - Cheapest Fake 85th Gucci Ltd.
- Next by thread: Re: Passing variables from shell script to another
- Index(es):