![]() |
|
|
|||||||
| Home | Forums | Register | Rules & FAQ | Members List | Arcade | 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 here. Shell Script Page. |
Other UNIX.COM Threads You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Need your Help on Unix Shell Scripting......... | vinayraj | UNIX for Advanced & Expert Users | 5 | 02-08-2008 03:00 AM |
| Unix Shell Scripting | premamadhuri | Shell Programming and Scripting | 4 | 11-04-2007 11:31 PM |
| Shell Scripting (Unix) | tt1ect | Shell Programming and Scripting | 3 | 04-15-2007 06:15 AM |
| difference between AIX shell scripting and Unix shell scripting. | haroonec | Shell Programming and Scripting | 2 | 04-12-2006 05:12 AM |
| Unix shell scripting | la_burton | UNIX for Dummies Questions & Answers | 6 | 10-22-2004 08:41 AM |
![]() |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||
|
Use of index in UNIX shell scripting
I have following line of code with me in one of the shell script.
LIST=`awk -v SRV=$SRV -v GRP=$GRP -v ID=$ID '{ if (index($0, GRP) && index($0, SRV) == 2 ) Can anybody help me in understanding the code ? specifically the bold one |
| Forum Sponsor | ||
|
|
|
|||
|
It looks like a syntax error. Perhaps you pasted too little, or too much. The index function takes two strings, and returns a positive number indicating where within the first the second occurs, or 0 if it does not occur. if(0) is non-true, whereas any other value is true.
|