Sponsored Content
Top Forums UNIX for Advanced & Expert Users Sort command - strange behaviour Post 302200037 by zaxxon on Wednesday 28th of May 2008 09:19:42 AM
Old 05-28-2008
Wrote nonsense - will come up with a better idea, brb Smilie

Here it is:

Code:
awk -F ";" '{print $2}' mwreport_joined.txt| sort -t ";" -rn -k 1,1 -k 2,2 -k 3,3 | xargs -I {} grep {} mwreport_joined.txt

Maybe not nice but works on Debian Linux. Not sure about the -I {} on xargs for other OS'es. On AIX I usually just leave it out iirc.

Last edited by zaxxon; 05-28-2008 at 10:29 AM..
 

10 More Discussions You Might Find Interesting

1. Linux

/etc/passwd strange behaviour!

Hi there, first of all, here is my conf of a uname -a Linux SAMBA 2.4.18-4GB #1 Wed Mar 27 13:57:05 UTC 2002 i686 unknown on a fedora machine. Here is my problem: every once in a while, the line containing root disappears in the /etc/passwd, disabling all logging on my server. Any one have... (0 Replies)
Discussion started by: penguin-friend
0 Replies

2. Shell Programming and Scripting

Help me to resolve uncertian behaviour of a sort command

I have got a file BeforeSort.txt having 40 fields seperated by "|" First field= RecordType (Value will be P or FP) Second field= CamCode Third field = UpdatingDate Fourth field = ProductType Fifth field = ActionCode (Value may be 01, 02 or 03) Sixth field = ProductCode and so on My... (1 Reply)
Discussion started by: pankajrai
1 Replies

3. UNIX for Dummies Questions & Answers

a strange message when executing the sort command

Dear all, when I issue the command: gunzip -c file.gz |sort the command is executed normally and correctly but a message keeps appearing everytime I run the command: the message: sort: missing NEWLINE added at end of input file STDIN Does anyone know what is the meaning of this message?... (3 Replies)
Discussion started by: marwan
3 Replies

4. Shell Programming and Scripting

A Strange Behaviour!!!

Can some-one give me a view to this : I have a directory in an unix server, having permissions r-xr-xr-x .This directory is basically a source directory. Now there is another directory basically the destination directory which has all the permissions. Note:I log in as not the owner,but user... (5 Replies)
Discussion started by: navojit dutta
5 Replies

5. UNIX for Advanced & Expert Users

Strange sed behaviour

$ echo a.bc | sed -e "s/\|/\\|/g" |a|.|b|c| $ Is the behavior of the sed statement expected ? Or is this a bug in sed ? OS details Linux 2.6.9-55.0.0.0.2.ELsmp #1 SMP Wed May 2 14:59:56 PDT 2007 i686 i686 i386 GNU/Linux (8 Replies)
Discussion started by: vino
8 Replies

6. UNIX for Dummies Questions & Answers

Strange Program behaviour

Had a strange thing going on with my code. It's ok I figured it out for myself.... (2 Replies)
Discussion started by: mrpugster
2 Replies

7. Shell Programming and Scripting

strange behaviour from sed???

Hi all, I want to do a very simple thing with sed. I want to print out the line number of a disk I have defined in /etc/exports, so I do: It's all good, but here's the problem. When I define md0 in a variable, I get nothing from sed: Why is that? can anybody please help? Thanks (2 Replies)
Discussion started by: alirezan
2 Replies

8. Red Hat

Crontab strange behaviour

Hi all, I'm having this scenario which for the moment I cannot resolve. :( I wrote a script to make a dump/export of the oracle database. and then put this entry on crontab to be executed daily for example. The script is like below: cat /home/oracle/scripts/db_backup.sh #!/bin/ksh ... (3 Replies)
Discussion started by: enux
3 Replies

9. Shell Programming and Scripting

Strange "cut" command's behaviour

Hi, Suppose if I have a file having data like this: $ cat file.txt A B C D And, if I do a cut operation like this: $ cut -d" " -f2 file.txt The output is A C D This is the same for even if we try to get the field 3 with -f3 (assume line 2 has 3 fields : C E F). The above... (1 Reply)
Discussion started by: royalibrahim
1 Replies

10. UNIX for Dummies Questions & Answers

linux sort command produces strange output

cat a .a ba .b bb .c bc sort a .a .b ba bb bc .c NOTE: .a and .b appears before ba and bb, where as .c appears after bc. In general (3 Replies)
Discussion started by: ajb
3 Replies
dragbox(1)																dragbox(1)

NAME
dragbox - Command line drag-and-drop tool for Gnome. SYNOPSIS
dragbox [-naxpu0] [--get | --list] [--name id] [item ...] DESCRIPTION
Dragbox is a tool for connecting the command line with the desktop environment. It summons a drag handle in a window when you are managing files or text in the shell, connecting the different workspaces -- desktop and command line. Dragbox can take items on the command line or from a pipe and put on its shelf. The inverse is also possible: dragged-to items can be out- put to the shell. It is possible to have more than one instance running, and put items on or get items from any of them. Right-click in the window to open a context menu or access the preferences window. Clicking an item copies it to the clipboard (files can be opened as an option). OPTIONS
-f, --file file Add file to the dragbox and report an error if it does not exist. -t, --text "snippet" Add snippet to the dragbox as text. This is needed explicitly if you want to treat an existing path as text. -n, --no-fork Do not fork after launch. This implies --write-on-exit. The program will not be able to communicate with other instances of itself. --get Query a running instance for its contents, output and exit. This respects settings affecting output format. Note that --get takes no arguments; use --name to specify which shelf to get. -m, --name name Use shelf identifier name. This can be used to have multiple dragboxes (shelves) available. --list List running instances. --window-title title Set window title to title. This will only have effect when the window is first created. Output settings -a, --write-async Output dragged-to items to standard output as they are received. -x, --write-on-exit Output contents of the dragbox to standard output at exit. -p, --paths Use absolute paths when outputing files. This is default. -u, --uris Use URIs when outputing files. -0, --null-terminate Separate dragged-in items' output with , not . This is useful together with xargs -0 The following are generic options -h, --help Displays usage information and exits. -v, --version Displays version information and exits. EXAMPLES
dragbox . file1.txt Adds the current directory and file1.txt to the currently running dragbox, or creates a new one. If file1.txt does not exist, its name is added as text. dragbox -t "Dragbox is cool" Adds a text snippet to the currently running dragbox, or creates a new one. dragbox --get -0 | xargs -0 tar cfz backup.tar.gz Get current items and pipe to xargs to create a tarball. Note that this simple command will have problems if contents include text items. dragbox --name remember . Put the current directory on a shelf called "remember" TIPS AND TRICKS
Dragging in gnome works very well, but there are some hidden tricks that can make some things easier. Pressing modifier keys can switch between different types of drags; dragging a file to nautilus normally copies it, but you can hold shift to move it, or shift-ctrl to make a symlink. You can drag from any window without activating it by holding the altgr or super key when you drag. This is often very useful. You can bring up a minimized or obscured window while dragging by hovering momentarily over it's button in the window list (in the gnome- panel) Just like minimized windows, you can switch workspaces while dragging if you hover over the workspaces switcher for a short while. If you selected something in a window and focus another window, it looks like the selection disappeared. In many cases it's still there, you can try to drag it without focusing the window (see above) Type escape while dragging to cancel the drag ACCESSING DRAGBOX
Dragbox needs an X session to run and display its shelves. However, to access dragbox shelves from non-graphical sessions, all you need is to make sure dragbox knows which X session to connect to. It might be enough to define the DISPLAY variable. AUTHOR
dragbox was written by Ulrik Sverdrup <ulrik.sverdrup@gmail.com> dragbox(1)
All times are GMT -4. The time now is 07:35 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy