Sort with Awk, sed ....


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Sort with Awk, sed ....
# 8  
Old 10-26-2010
SunOS 5.10 Generic_127127-11 sun4u sparc SUNW,SPARC-Enterprise
# 9  
Old 10-26-2010
Use nawk or /usr/xpg4/bin/awk instead of awk.
This User Gave Thanks to Scrutinizer For This Post:
# 10  
Old 10-26-2010
it worked! thanks
# 11  
Old 11-08-2010
awk or grep or sed???

$DLC/bin/rfutil db1 -C aimage list
i am using this command and gettin d output below..
Extent: 1
Status: Empty
Type: Fixed Length
Path: /home/mralbu/ai_dir/db1.a1
Size: 8184
Used: 0
Start: N/A
Seqno: 0

Extent: 2
Status: Full
Type: Fixed Length
Path: /home/mralbu/ai_dir/db1.a2
Size: 8184
Used: 1
Start: Mon Nov 8 14:21:51 2010
Seqno: 54

Extent: 3
Status: Busy
Type: Fixed Length
Path: /home/mralbu/ai_dir/db1.a3
Size: 8184
Used: 1
Start: Mon Nov 8 14:21:55 2010
Seqno: 55

Extent: 4
Status: Empty
Type: Variable Length
Path: /home/mralbu/ai_dir/db1.a4
Size: 120
Used: 0
Start: N/A
Seqno: 0

i want to get the Seqno for evry particular db1 after image n assign it as SEQNC..


i used this command below... n its workin..
SEQNC=`$DLC/bin/rfutil $DB -C aimage scan -a $EXT_NAME |grep number |tail -1 |awk '{print $6}'`

bt for that i need to keep my databse shut..
wat do i do...

help asap..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Wget, grep, sort, sed in 1 command/script

Hi, I need to join these statements for efficiency, and without having to make a new directory for each batch. I'm annotating commands below. wget -q -r -l1 URL ^^ can't use -O - here and pipe | to grep because of -r grep -hrio "\b\+@\+\.\{2,4\}\+\b" * > first.txt ^^ Need to grep the output... (14 Replies)
Discussion started by: p1ne
14 Replies

2. Shell Programming and Scripting

sed --> sort data by date

Hi, i "tried" to sort data by date. So far, i used sed to take the data from the last and the actual month. Now, after changing the year it is not working properly. i use: GNU bash, version 4.2.45(1)-release (x86_64-suse-linux-gnu) sed -n '/\//p' $Home/../scripte/pd_0.txt y is a... (6 Replies)
Discussion started by: IMPe
6 Replies

3. Shell Programming and Scripting

Want to sort a file using awk & sed to get required output

Hi All, Need Suggestion, Want to sort a file using awk & sed to get required, output as below, such that each LUN shows correct WWPN and FA port Numbers correctly: Required output: 01FB 10000000c97843a2 8C 0 01FB 10000000c96fb279 9C 0 22AF 10000000c97843a2 8C 0 22AF 10000000c975adbd ... (10 Replies)
Discussion started by: aix_admin_007
10 Replies

4. Shell Programming and Scripting

awk sort

input file abc1 abc23 abc12 abc15 output abc1 abc12 abc15 abc23 (9 Replies)
Discussion started by: yanglei_fage
9 Replies

5. Shell Programming and Scripting

Remove duplicate chars and sort string [SED]

Hi, INPUT: DCBADD OUTPUT: ABCD The SED script should alphabetically sort the chars in the string and remove the duplicate chars. (5 Replies)
Discussion started by: jds93
5 Replies

6. Shell Programming and Scripting

Using a combination of sort/cut/grep/awk/join/paste/sed

I have a file and need to only select users that have a shell of “/bin/bash” in the line using awk or sed please help (4 Replies)
Discussion started by: boyboy1212
4 Replies

7. Shell Programming and Scripting

2 problems... sed and sort

Hi everyone! I have a file like that: And I would it like that: I don't know how to keep the first field and sort the second one. I have a second question with sed... to put the variable $VAR at the beginning of the file... But I have an output like this: snork... (3 Replies)
Discussion started by: Castelior
3 Replies

8. Shell Programming and Scripting

Help, awk sed sort

Hi,everyone: I'm new to shell, and now get trouble with some script: line=`/usr/xpg4/bin/awk '/^(*\|){2}'"$CR"'/ {print $0}' ${TIER4FILE}|grep -v OSNAME=`sed -n ''$LINE'p' $DATALOC/os` sort +1 /tmp/LhasaCRs2 > /tmp/LhasaCRs1 I cannot understand the "{2}" here. My mentor said it... (1 Reply)
Discussion started by: mycoy
1 Replies

9. Shell Programming and Scripting

Sed with sort doesnt work

Sed with sort doesnt work The below code doesnt work: sed -e '/^$/d' -e 's/,/|/g' | sort -t"|" -k1,1 -u file1 when i seperate them it work but i have to create intermediate file which i dont want to: sed -e '/^$/d' -e 's/,/|/g' file1 > file2 sort -t"|" -k1,1 -u file2 Help... (2 Replies)
Discussion started by: pinnacle
2 Replies

10. Shell Programming and Scripting

how to use sed to sort out this question

root:x:0:0:0000-Admin(0000):/:/sbin/sh rootcsh:x:0:1:0000-Admin(0000):/:/bin/csh nocol:x:6312:630:NOCOL Monitor,,,:/usr/local/lib/nocol-client:/usr/local/bin/bash nobody:x:60001:60001:uid no body:/:/usr/local/bin/bash noaccess:x:60002:60002:uid no access:/:/usr/local/bin/bash... (2 Replies)
Discussion started by: sonicstage
2 Replies
Login or Register to Ask a Question