![]() |
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 |
| can someone tell me what im doing wrong here | iago | UNIX for Dummies Questions & Answers | 2 | 09-10-2007 09:20 AM |
| what am i doing wrong | iago | UNIX for Dummies Questions & Answers | 4 | 09-04-2007 07:27 AM |
| What’s wrong with the following? | vrn | UNIX for Dummies Questions & Answers | 8 | 03-19-2006 09:09 PM |
| What was wrong ??? ksh | sabercats | Shell Programming and Scripting | 11 | 02-27-2006 01:12 PM |
| Please tell me what do I do wrong here! | bobo | UNIX for Dummies Questions & Answers | 4 | 02-20-2006 10:55 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
What's going wrong with sort?
Sort isn't behaving as I expect. Can someone tell me what's going on?
Incidentally, the infile was ordered by 'sort' previously. Why is 101m_lig1_frag1 before 101m_lig1_frag12 but after 101m_lig1_frag11? $infile... 101m_lig1_frag10 124 ... 101m_lig1_frag11 124 ... 101m_lig1_frag12 124 ... 101m_lig1_frag13 124 ... 101m_lig1_frag1 124 ... 101m_lig1_frag14 124 ... 101m_lig1_frag15 124 ... 101m_lig1_frag16 124 ... 101m_lig1_frag17 124 ... 101m_lig1_frag18 124 ... 100> sort $infile > $outfile $outfile 101m_lig1_frag10 124 ... 101m_lig1_frag11 124 ... 101m_lig1_frag1 124 ... 101m_lig1_frag12 124 ... 101m_lig1_frag13 124 ... 101m_lig1_frag14 124 ... 101m_lig1_frag15 124 ... 101m_lig1_frag16 124 ... 101m_lig1_frag17 124 ... 101m_lig1_frag18 124 ... |
|
||||
|
Thanks, but I'm still getting the same result... wierd!
daisy 1807>cat head.fps | awk '{print $1,$2,"..."}' | sort -d 101m_lig1_frag10 124 ... 101m_lig1_frag11 124 ... 101m_lig1_frag1 124 ... 101m_lig1_frag12 124 ... 101m_lig1_frag13 124 ... 101m_lig1_frag14 124 ... 101m_lig1_frag15 124 ... 101m_lig1_frag16 124 ... 101m_lig1_frag17 124 ... 101m_lig1_frag18 124 ... |
|
||||
|
Quote:
One option would be: Code:
for each in $(sed 's/101m_lig1_frag\(.*\) 124\(.*\)/\1/' infile | sort -n); do grep "^101m_lig1_frag$each " infile; done Quote:
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|