Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19
Sorting problems again
Results 1 to 3 of 3

Thread: Sorting problems again

  1. #1
    Junior Member
    Join Date
    Feb 2002
    Posts
    59

    Sorting problems again

    okay what i have done is created a total of three files from the etc/passwd file

    File one named: names (This file a got all the users names from the /etc/passwd file and put them in this file.
    File two named: userid (This file I got all userid's from the /etc/passwd file and put them in this file.
    File three: users.ref (This file I pasted with a space as delimiator of the names and userid files together)
    Had use the command paste -d" " userid names > users.ref

    now that the contents of the file users.ref is clear my object is to eventurally write a script using this one of display the entire contents of the users.ref file in aphalbetical order by last name .

    Right now Im just working on the sorting of this so i can figure out how to write the script.

    For exampe the file looks like this.im making up userid and such cuz i can't post it here.

    Code:
    sn12345 Karin Neostar
    So basically im struggling how to sort this file by last name altho the first and last name are considered as one field. I can sort by fields no problem but not part of a field.

    Any ideas?

    TIA

  2. #2
    Junior Member
    Join Date
    Feb 2002
    Posts
    59

    Re:Sorting problems again

    oh forgot to mention, this is using unix with the korn shell.

  3. #3
    Junior Member
    Join Date
    Feb 2002
    Posts
    59

    Re:Sorting problems again

    I think i got it now.

    cat users.ref |sort -k3

    I keep forgeting about the k.

Similar Threads

  1. Sorting the command history of a shell
    By tech291083 in forum Redhat / Fedora
    Replies: 1
    Last Post: 05-14-2007, 12:23 PM
  2. Sorting through the Linux lie: What it really can do
    By cloverm in forum General Chat
    Replies: 5
    Last Post: 07-01-2005, 05:46 PM
  3. IRC problems
    By Fatal Error in forum Linux - General Topics
    Replies: 4
    Last Post: 06-15-2004, 08:45 PM
  4. NIC Problems
    By GhostDawg in forum Linux - Hardware, Networking & Security
    Replies: 16
    Last Post: 08-30-2003, 04:24 PM
  5. Bash script for sorting mp3's.
    By airhead in forum Programming
    Replies: 7
    Last Post: 02-24-2002, 07:09 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •