![]() |
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 |
| assign a command line argument and a unix command to awk variables | sweta_doshi | Shell Programming and Scripting | 0 | 08-08-2008 06:54 AM |
| Help Required: Command to find IP address and command executed of a user | loggedout | Security | 2 | 08-06-2008 08:12 PM |
| how to? launch command with string of command line options | TinCanFury | Shell Programming and Scripting | 5 | 04-28-2008 06:06 PM |
| inconsistent ls command display at the command prompt & running as a cron job | rajranibl | SuSE | 5 | 07-30-2007 08:26 AM |
| How to use more than one MPE command STREAM with Unix command in a single shell? | bosskr | HP-UX | 1 | 10-16-2006 04:16 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
AWK command
Hi,
Please help me in doing this.. $ disklabel dsk1 # /dev/rdisk/dsk1c: type: SCSI disk: BD018635C4 label: flags: dynamic_geometry bytes/sector: 512 sectors/track: 254 tracks/cylinder: 20 sectors/cylinder: 5080 cylinders: 7001 sectors/unit: 35565080 rpm: 10025 interleave: 1 trackskew: 84 cylinderskew: 74 headswitch: 0 # milliseconds track-to-track seek: 0 # milliseconds drivedata: 0 8 partitions: # size offset fstype fsize bsize cpg # ~Cyl values a: 131072 0 unused 0 0 # 0 - 25* b: 262144 131072 unused 0 0 # 25*- 77* c: 35565080 0 unused 0 0 # 0 - 7000 d: 0 0 unused 0 0 # 0 - 0 e: 0 0 unused 0 0 # 0 - 0 f: 0 0 unused 0 0 # 0 - 0 g: 17585932 393216 unused 0 0 # 77*- 3539* h: 17585932 17979148 unused 0 0 # 3539*- 7000 Above is the "disklabel" (command) output . From above output first it must take 4 partitions(a: , b: , g: . h: ) . And it must check fstype column =unused for all above 4 partitions.And among those 4 partitions finally i need the partitions which has fstype=unused. Please let me know how to get the output by using awk or by any other commands.. Thanks, mansa. |
|
||||
|
Hi zaxxon,
I tried as per your comments..Could you please look at it... $ disklabel dsk2 > infile t=`awk '/^a|^b|^g|^h/ && $4 == "unused" {sub(/:/,"",$1); print $1}' infile` $ echo $t $ It didnt display any output... Could you please let me know how to get value in $t. Thanks in Advance, Mansa |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|