Results 1 to 3 of 3
Hi,
If i am using following code my script is working fine:
>cat test
name=$1
echo "your name is $name"
I am getting valid response for this.But if i am ...
- 03-17-2008 #1Just Joined!
- Join Date
- Nov 2007
- Posts
- 10
Not able to pass parameter in main function of Shell Script
Hi,
If i am using following code my script is working fine:
>cat test
name=$1
echo "your name is $name"
I am getting valid response for this.But if i am using a main function and passing the parameter its not working.
>cat test
main()
{
name =$1
echo "your name is $name"
}
main
Output while using this code is as follow:
>./test hello
your name is
Kindly suggest what should I do to make it working.
Thanks-
Yogender
- 03-17-2008 #2Just Joined!
- Join Date
- Nov 2007
- Posts
- 10
Hi All,
Now I got it and i am able to make it working.
Thanks-
Yogender
- 03-19-2008 #3


Reply With Quote
