Kindly help : sort


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Kindly help : sort
# 1  
Old 04-10-2008
Kindly help : sort

Iam new to Unix ....analyzing the code
Can any one pls explain what does it mean by below code
Code:
sort +0 -1 +1 -2 +2 -3n +3 -4n +4 -5n    file.txt  -o





awaiting for reply .....

Last edited by Yogesh Sawant; 04-10-2008 at 04:09 AM.. Reason: added code tags
# 2  
Old 04-27-2008
Hi there,

it is an obsolete method of sorting according to the specific feilds and characters in them; you would see -k key as a replacement of this method.

+m refers to a feild_start and -m is feild_end where m=0,1,2,3,.....to some no.of feilds available in the file to be sorted.
and the 'n' used with (-3n, -4n and -5n) specifies to make a numeric sort on that particular feild.
so, your code does sort on first feild, second feild, numeric sort on third feild, numeric sort on fourth feild and numeric sort on fifth feild.

and the -o option is to specify a file to store this soretd o/p.

by default space would be the feild seperator; optionally you can use -t with some character as a feild seperator.

-ilan
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Kindly Help regarding sorting a file rows

Dear All, I have a file name exporting.txt. Below is the content. $ cat exporting.txt . . exporting table DT_BCD 63716 rows exported . . exporting table DT_CVD 36321 ... (2 Replies)
Discussion started by: sudiptabhaskar
2 Replies

2. Shell Programming and Scripting

FTP Transfer fails at first time. Kindly help

This is the command we use to transfer the file to destination we ran this command from batch job. first time it hangs. when we cancel and ran it again it works in 5 sec. anyone come out without solution..? ftp -n destinationftp << CMDEND user user/passwd lcd ${root}path cd path put... (1 Reply)
Discussion started by: shenthil76
1 Replies

3. Post Here to Contact Site Administrators and Moderators

kindly move thread

kindly move this thread: https://www.unix.com/unix-dummies-questions-answers/176868-get-all-strings-after-equal-sign.html to Shell Programming and Scripting...created in wrong forum... thanks!!! (0 Replies)
Discussion started by: h0ujun
0 Replies

4. Solaris

CJS instalation one problem...kindly help

hi am installing CJS frm one server to a cleint and i first did ./add_install_client -e now i need to know the mac add of the client so i entered into client and now hopw can i go to ok prmt ^] when this symbol is entered am nt being able to enter to ok promt what to do i... (1 Reply)
Discussion started by: all_is_well
1 Replies

5. Shell Programming and Scripting

kindly help me out on this please

Hello experts, please help me on this. This is the scenario: I have applications like BigBrother,PowerKeeper/PowerBroker etc.. which I have to install during server build for both AIX and Solaris. I already have separate installation scripts for both OS for all applications. Now, I want to... (0 Replies)
Discussion started by: solaix14
0 Replies

6. Shell Programming and Scripting

comparing 2 files - kindly assist expert

Hi, I'm new in shell scripting and would like u guys to help on this. OS: Solaris 9 currently, i have 2 files. file1: hello hi test god file2: hi hello file1 is my masterfile, and i wanted to print out string that are in file1 and NOT in file2 and send out a mail (with the... (15 Replies)
Discussion started by: chew
15 Replies

7. Shell Programming and Scripting

Can someone kindly help with appending problem!!!

Hi guys,i urgently need help in this problem,i need to append one sentence to another line when it meet a certain word. For example: root: root time_last_login = 1191232080 root tty_last_login = /dev/vty0 root host_last_login = rep1nim root unsuccessful_login_count = 0 root... (10 Replies)
Discussion started by: cyberray
10 Replies

8. Shell Programming and Scripting

FOR loop problem: Kindly Help

Hello Friends, I have file called reference.txt which looks like below, columns are been formed by delimiter "|" as shown. I am required to scan whole file line by line & compare 1st 2 columns with new name (ex. ferrari) & new version (2.1). CODE PURPOSE: whnever new project formed... (6 Replies)
Discussion started by: okdev
6 Replies
Login or Register to Ask a Question