![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| test | skooly5 | UNIX for Dummies Questions & Answers | 1 | 04-07-2008 06:38 AM |
| TAHI Test Suite 3.0.13 (IPv6 Conformance Test Tool branch) | iBot | Software Releases - RSS News | 0 | 04-06-2008 09:20 AM |
| test and .test in same directory | vikashtulsiyan | SUN Solaris | 14 | 12-27-2007 11:25 PM |
| Test : Which OS are you ? | sysgate | What's on Your Mind? | 8 | 08-29-2007 03:36 PM |
| Keithley Introduces Linux-Based RF Parametric Test Systems - Test and Measurement.com | iBot | UNIX and Linux RSS News | 0 | 07-23-2007 07:30 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
Hi,
In one of the scripts i have seen this code if test $# = 2 then LOG_FILE=$2 else LOG_FILE=$SYNC_PATH/logs/$BASENAME.log fi can someone help me with what " test $# " signifies.. Thanks in advance.. |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
$# holds the number of command line arguments passed to a shell script.
Look at this script. Code:
[~/temp]$ cat shell.sh #! /bin/sh echo $# Code:
[~/temp]$ ./shell.sh 0 [~/temp]$ ./shell.sh arg1 1 [~/temp]$ ./shell.sh arg1 agr2 2 [~/temp]$ ./shell.sh arg1 agr2-arg3 2 See man test for more on test Code:
if test $# = 2 Code:
if [ $# = 2 ] vino Last edited by vino; 10-04-2005 at 03:49 AM. |
|
#3
|
|||
|
|||
|
GOT IT!!!
Thanks.. |
|||
| Google The UNIX and Linux Forums |