HELP PLS!! Shell Scripting!!


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting HELP PLS!! Shell Scripting!!
# 8  
Old 09-16-2006
Quote:
Originally Posted by sayonm
Code:
for ((i=1;i<=`awk -F'|' '{print $2}' file | uniq | wc -l`;i++))
do
        word=`awk -F'|' '{print $2}' file | uniq |head -$i | tail -1`
        echo $word
        grep "$word" file | awk -F'|' '{print $3,$1,$4}'
done

just my opinion, there are too many pipes , and file i/o.
# 9  
Old 09-16-2006
Computer

ya right.....just my style Smilie

anyways i just wrongly named my previous post as "just another simple soln"....it should have been "just another soln"..... Smilie
# 10  
Old 09-16-2006
Code:
awk -F" " 'BEGIN{x=""} { if ( $2 != x ) { print $2, "\n", $3,  $1, $4; x=$2 } else { print $3, $1, $4 } }' filename

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need help with first shell script pls.

Hi, I'm trying to extract information from one file to update another one and am a bit stuck. the first file is made up of tags e.g. <item>a@b.com</item> jksdhfjkdsh sldkjfds l klsjdf <item> c@d.com </item> what i'd like to do is extract the email addresses between these tags,... (6 Replies)
Discussion started by: newb1000
6 Replies

2. Shell Programming and Scripting

Shell scripting : pls help me

I have an input file in this format (shown below). I have to select the lines which doesnt followed by 'miR-" and to save such lines into an output file. For easy identification they are shown here in blue color. They have to be selected. Pls. help me to write a shell script to select those lines... (5 Replies)
Discussion started by: hravisankar
5 Replies

3. Shell Programming and Scripting

Shell program help pls

first queestion if what does "-s" mean? second seqx -n 10000000 -c 10 < $seqfile >$temp seqx? -n? -c? what do these mean? third if && ! cmp -s $missing $temp explain these codes ty (2 Replies)
Discussion started by: imtheone
2 Replies

4. Shell Programming and Scripting

scripting/awk help : awk sum output is not comming in regular format. Pls advise.

Hi Experts, I am adding a column of numbers with awk , however not getting correct output: # awk '{sum+=$1} END {print sum}' datafile 2.15291e+06 How can I getthe output like : 2152910 Thank you.. # awk '{sum+=$1} END {print sum}' datafile 2.15079e+06 (3 Replies)
Discussion started by: rveri
3 Replies

5. Shell Programming and Scripting

shell script, pls help

# for i in `cat oo`;do ls -ld $i;done ls: /var/tmp/i: No such file or directory ls: i: No such file or directory ls: /var/tmp/ii: No such file or directory ls: i: No such file or directory ls: /var/tmp/iii: No such file or directory ls: i: No such file or directory ls: /var/tmp/iiii: No such... (2 Replies)
Discussion started by: cpttak
2 Replies

6. UNIX for Advanced & Expert Users

pls help me in scripting

i want to write a script that if the time is 8 then it give a message that the time is 8 and if it is 9-10 then it gives a message that time to go to office like that. can any one help me? (3 Replies)
Discussion started by: lakshmananindia
3 Replies

7. Shell Programming and Scripting

hi..all..pls...help..!!..profile scripting..

hi.. I want to customize a user in unix which could have only ftp access and NO TELNET ACCESS! ..... As being a newbie to unix to my understanding the user .profile has to be edited but if someone can explain how to edit it so that i can block telnet access for that user.....Is /etc/profile has... (5 Replies)
Discussion started by: rookie250
5 Replies

8. Shell Programming and Scripting

HELP me PLS... Simple Scripting!

this is my script.... SQL> select * from dba_profiles 2 where resource_name in ('FAILED_LOGIN_ATTEMPTS','PASSWORD_LOCK_TIME') 3 order by profile; and this is the output... PROFILE RESOURCE_NAME RESOURCE... (2 Replies)
Discussion started by: liezer
2 Replies

9. Shell Programming and Scripting

difference between AIX shell scripting and Unix shell scripting.

please give the difference between AIX shell scripting and Unix shell scripting. (2 Replies)
Discussion started by: haroonec
2 Replies

10. Shell Programming and Scripting

scripting guru's pls help me with scripting on AIX

can someone pls help me with the script for a files coming from one system to a particular directory and i want to write a script to move those files to another directory on different system by renaming the files... pls someone help me on this... thanking in anticipation.... (1 Reply)
Discussion started by: thatiprashant
1 Replies
Login or Register to Ask a Question