![]() |
|
|
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. |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Regarding awk
Hi ,
In shell script I wrote: awk '$1 == "name" {print $2 }' /home/test/name.log means in that file if first word is "name" than I print second word. Problem is : sometimes in that file , first word is "name" nothing is there as second word. Actual name is in the next line as second word. means if $2 is null i want third word in next line. How to handle this situation |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|