Sort Old Style Key Definition


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Sort Old Style Key Definition
# 1  
Old 03-21-2008
Data Sort Old Style Key Definition

Hello guys,

I am quite confused with old style key definitions.

Below is the example:

sort -o $sortfile +0.75 -0.84 $input

According to the manual, the key field should start at 75th character of the 1st(0+1) field and key's last position should be 84th character after end of "0"th field

Can anyone explain me what is the "0"th field and how actually the key is defined in the case above Smilie

Also, please tell me what happens if the key definition exceeds the range of input file ( for example if the longest line is or 40 character, and i define the key from 80-85) Smilie

Thanks in advance!!
 
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Programming

Get struct definition

I have many headers with huge amount of structures in them, typical one looks like this: $ cat a.h struct Rec1 { int f1; int f2; }; struct Rec2 { char r1; char r2; }; struct Rec3 { int f1; float k1; float ... (6 Replies)
Discussion started by: migurus
6 Replies

2. Solaris

Solaris 8 ssh public key authentication issue - Server refused our key

Hi, I've used the following way to set ssh public key authentication and it is working fine on Solaris 10, RedHat Linux and SuSE Linux servers without any problem. But I got error 'Server refused our key' on Solaris 8 system. Solaris 8 uses SSH2 too. Why? Please help. Thanks. ... (1 Reply)
Discussion started by: aixlover
1 Replies

3. UNIX for Dummies Questions & Answers

Definition of $-

Could someone please direct me to a link that gives the definitions for each of the letters from the results of the $- environment variable? It would be nice to know what shell options each of the letters represents, but I am specifically looking for the shell option for 'c' (lowercase c). Thank... (12 Replies)
Discussion started by: sszd
12 Replies

4. Shell Programming and Scripting

Perl function to sort a file based on key fields

Hi, I am new to PERL.I want to sort all the lines in a file based on 1,2 and 4th filelds. Can U suggest me a command/function in perl for this operation.. (5 Replies)
Discussion started by: karthikd214
5 Replies

5. Shell Programming and Scripting

daemons definition

hi there, can somebody give me a definition for daemons, or example what are they !! and what the use for? i've done some research and all what i found is /etc/... or /usr/bin/... and i haven't quietly got the concept. any ideas !! Thanks. (5 Replies)
Discussion started by: new2Linux
5 Replies

6. UNIX for Dummies Questions & Answers

Pressing backspace key simulates enter key

Hi, Whenever i press the backspace key, a new line appears, i.e. it works like a enter key. :confused: Thanks (2 Replies)
Discussion started by: vibhor_agarwali
2 Replies

7. UNIX for Dummies Questions & Answers

2nd sort key

Hi, I was trying to sort a file with one sort key in the first field and trying to sort again based on the 2nd field. After the sort command , the first sorted file will look like this: 1 apple OH 2 pear OH 3 pear IL 4 apple FL 5 pear FL 6 apple MI I'd like to have it sort on the 2nd... (1 Reply)
Discussion started by: whatisthis
1 Replies

8. Post Here to Contact Site Administrators and Moderators

New Style

Hi, I pop in here every so oftern and was suprised to see the changes in colour. I think the new style/colour is great :D (1 Reply)
Discussion started by: Ralf
1 Replies
Login or Register to Ask a Question
look(1) 						      General Commands Manual							   look(1)

NAME
look - Finds lines in a sorted list SYNOPSIS
look [-df] [-tcharacter] string [file] The look command prints all lines in a sorted file that begin with string. OPTIONS
Uses dictionary order; only letters, digits, tabs, and spaces are used in comparisons. Searches without regard to case; treats uppercase and lowercase as equivalent. Ignores character and characters following it in the search string. If you specify look -tC ABCDE, the string ABCDE would become (in effect) AB, with CDE being ignored. This option is primarily for shell scripts, in which more than one string is being processed. DESCRIPTION
If no file is specified, look searches in the system word list /usr/share/dict/words, with the options -df assumed by default. The look command uses binary search. The -d and -f options affect comparisons as in sort. NOTES
In order to use the -f option, you must first sort file with the sort -f command; otherwise, look displays only lowercase items. If you do not specify -f, but specify a file (such as /usr/share/dict/words) that has been sorted with sort -f, look may not produce any output. EXAMPLES
To search a sorted file called sortfile for all lines that begin with the string as, enter: look as sortfile To search the system word list for all words beginning with smi, enter: look smi This might result in: smile smirk smith smithereens Smithfield Smithson smithy smitten FILES
System word list. SEE ALSO
Commands: grep(1), sort(1), spell(1) look(1)