![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Small Search script | appu1987 | Shell Programming and Scripting | 2 | 06-03-2008 10:14 PM |
| small script help | ali560045 | Shell Programming and Scripting | 9 | 01-18-2008 10:18 AM |
| Very small Shell Script Help... | marconi | Shell Programming and Scripting | 2 | 12-11-2007 05:44 AM |
| small script | everurs789 | Shell Programming and Scripting | 3 | 11-06-2007 05:08 PM |
| Need help in a small script | super_duper_guy | Shell Programming and Scripting | 2 | 10-24-2005 10:06 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
small script help
here is a small script:
if [ $# -lt 1 ]; then echo please enter an argument fi if [ "$1" = "tom"; then a=$1 echo $a fi here is my question. if the script name is j.sh and I run it : j.sh from shell prompt: without a parameter: it prints please enter an argument but if I go with . j.sh (current shell execution): it does not show that. also if I go with an argument $ j.sh tom or $ . j.sh tom the result is identical. however the next time I go with no argument, still I see the variable has a value tom with $ . j.sh tom. what makes the current shell execution keep the variable to value assigned even if on the next trun no argument is passed. any suggestion would be highly appreciated. thanks. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|