Re: Sorting only certain data in file.

From: Greg Beeker (gbeeker_at_gmail.com)
Date: 02/16/05


Date: 16 Feb 2005 05:12:04 -0800


TB wrote:
> I have a text file that has a lot of data in it that I need to sort.
I
> have an application that has a command similar to `who` that shows
all
> the users that are logged into the app. Every hour I have a script
> that gets the hostname, date, and the users. Unfortunately the
command
> doesn't sort the users how I would like. What i would like is to
sort
> by the users so that I can see multiple logins. Or better yet, show
> only the duplicate logins (in full so that I can see how many times
> they are logged in).
>
I'd suggest you add a sort command in the script that generates this
file.
Like this:

hostname
date
users | sort

Where 'users' is the command that generates the user list. By the way,
the users command actually will show the users on your system.



Relevant Pages

  • coreutils-7.3 released [stable]
    ... been a few other interesting fixes and improvements. ... run a command like this: ... sort -m no longer segfaults when its output file is also an input file. ... destination file system with a fundamental block size of 4KiB or greater. ...
    (gnu.announce)
  • Re: FC1 Install _appeared_ to work, BUT...
    ... what sort of messages do make it to screen? ... I used to run RHL7.3, dual booting, on a Sony Vaio laptop. ... command prompt only safe-mode in windows but without the GUI). ...
    (Fedora)
  • Re: [OT] Compiler warning level
    ... > have command lines" when they enter the course. ... I started -- well, OK, unless you count the front panel switches and the ... lights on the panel could be called a GUI, they were sort of graphical ... I tend to write the makefile before typing in the start of the ...
    (comp.lang.c)
  • Re: getline caveats misuse howto
    ... populates the ERRNO builtin variable if getline fails. ... down the two-way pipe to the UNIX "sort" command. ... gawk terminates the coprocess and exits. ...
    (comp.lang.awk)
  • Re: BROWSE: order by column
    ... oHdr is now a reference to the header object ... descending sort. ... If you have a lot of columns that would be a lot of command ... Just add the code to change the sort order to a new ...
    (microsoft.public.fox.programmer.exchange)