Sponsored Content
Top Forums UNIX for Advanced & Expert Users Alternative to sort -ur +1 required Post 302709827 by Mike Smith on Wednesday 3rd of October 2012 03:49:59 PM
Old 10-03-2012
Alternative to sort -ur +1 required

I've got scripts trawling the network and dumping parsed text into files with an Epoch timestamp in column 1. I append the old data to the new data then just want to keep the top entry if there is an identical duplicate below (column 1 needs to be ignored).

sort -ur +1 works a treat on a Solaris 8 box but on Solaris 10 the 'r' seems to break!

Can some kind soul offer a fix / workaround?

If you ask me a question please keep it dummy level as I'm not super Unix literate.
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

sort out the required data

Hi All, I have a file 1.txt which has the duplicate dns entries as shown: Name: 000f9fbc6738.net.in|Addresses: 10.241.66.169, 10.84.2.222,212.241.66.170 Name: 001371e8ed3e.net.in|Addresses: 10.241.65.153, 10.84.1.101 Name: 00e06f5bd42a.net.in|Addresses: 10.72.19.218,... (6 Replies)
Discussion started by: imas
6 Replies

2. Shell Programming and Scripting

Getting required fields from a test file in required fromat in unix

My data is something like shown below. date1 date2 aaa bbbb ccccc date3 date4 dddd eeeeeee ffffffffff ggggg hh I want the output like this date1date2 aaa eeeeee I serached in the forum but didn't find the exact matching solution. Please help. (7 Replies)
Discussion started by: rdhanek
7 Replies

3. Shell Programming and Scripting

How to Sort Floating Numbers Using the Sort Command?

Hi to all. I'm trying to sort this with the Unix command sort. user1:12345678:3.5:2.5:8:1:2:3 user2:12345679:4.5:3.5:8:1:3:2 user3:12345687:5.5:2.5:6:1:3:2 user4:12345670:5.5:2.5:5:3:2:1 user5:12345671:2.5:5.5:7:2:3:1 I need to get this: user3:12345687:5.5:2.5:6:1:3:2... (7 Replies)
Discussion started by: daniel.gbaena
7 Replies

4. UNIX for Dummies Questions & Answers

How to insert alternative columns and sort text from first column to second?

Hi Everybody, I am just new to UNIX as well as to this forum. I have a text file with 10,000 coloumns and each coloumn contains values separated by space. I want to separate them into new coloumns..the file is something like this as ad af 1 A as ad af 1 D ... ... 1 and A are in one... (7 Replies)
Discussion started by: Unilearn
7 Replies

5. UNIX for Advanced & Expert Users

Script to sort the files and append the extension .sort to the sorted version of the file

Hello all - I am to this forum and fairly new in learning unix and finding some difficulty in preparing a small shell script. I am trying to make script to sort all the files given by user as input (either the exact full name of the file or say the files matching the criteria like all files... (3 Replies)
Discussion started by: pankaj80
3 Replies

6. Shell Programming and Scripting

Want to sort a file using awk & sed to get required output

Hi All, Need Suggestion, Want to sort a file using awk & sed to get required, output as below, such that each LUN shows correct WWPN and FA port Numbers correctly: Required output: 01FB 10000000c97843a2 8C 0 01FB 10000000c96fb279 9C 0 22AF 10000000c97843a2 8C 0 22AF 10000000c975adbd ... (10 Replies)
Discussion started by: aix_admin_007
10 Replies

7. Shell Programming and Scripting

Help with sort word and general numeric sort at the same time

Input file: 100%ABC2 3.44E-12 USA A2M%H02579 0E0 UK 100%ABC2 5.34E-8 UK 100%ABC2 3.25E-12 USA A2M%H02579 5E-45 UK Output file: 100%ABC2 3.44E-12 USA 100%ABC2 3.25E-12 USA 100%ABC2 5.34E-8 UK A2M%H02579 0E0 UK A2M%H02579 5E-45 UK Code try: sort -k1,1 -g -k2 -r input.txt... (2 Replies)
Discussion started by: perl_beginner
2 Replies

8. Shell Programming and Scripting

Sort help: How to sort collected 'file list' by date stamp :

Hi Experts, I have a filelist collected from another server , now want to sort the output using date/time stamp filed. - Filed 6, 7,8 are showing the date/time/stamp. Here is the input: #---------------------------------------------------------------------- -rw------- 1 root ... (3 Replies)
Discussion started by: rveri
3 Replies

9. UNIX for Dummies Questions & Answers

Best Alternative for checking input parameter contains required value or not

Any good way to check if code has the required output # /sbin/sysctl net.ipv4.icmp_echo_ignore_broadcasts net.ipv4.icmp_echo_ignore_broadcasts = 1 /sbin/sysctl net.ipv4.icmp_echo_ignore_broadcasts | grep "= 1" net.ipv4.icmp_echo_ignore_broadcasts = 1 What I can think of is above, and it... (16 Replies)
Discussion started by: alvinoo
16 Replies

10. Shell Programming and Scripting

How to Modify a file content in UNIX and sort for only required fields ?

I have the below contents in a file after making the below curl call curl ... | grep -E "state|Rno" | paste -sd',\n' | grep "Disconnected" > test "state" : "Disconnected",, "Rno" : "5554f1d2" "state" : "Disconnected",, "Rno" : "10587563" "state" : "Disconnected",, "Rno" :... (2 Replies)
Discussion started by: Vaibhav H
2 Replies
gtkcookie(1)						      General Commands Manual						      gtkcookie(1)

NAME
gtkcookie - edit Netscape cookie file SYNOPSIS
gtkcookie [ Gtk options ] DESCRIPTION
Options gtkcookie supports the command flags common to all Gtk applications. There are no gtkcookie-specific flags. What happens at startup On startup, gtkcookie will try to find your Netscape cookie file by looking for ~/.netscape/cookies. If ~/.netscape/cookies is found, gtk- cookie will load the file and show it in a multi-column list. Opening a cookie file Regardless of whether gtkcookie finds your cookie file, or you have to open it manually, when you open the file, all of your Netscape cook- ies are displayed in whatever order Netscape wrote them into the file. Sorting a cookie file You can sort the cookies by any column by clicking on the heading for that column. Human-readable dates The final column is actually not stored in your cookie file, but is a translation of Netscape's native date field. Netscape stores the date as the number of seconds since 1 Jan 1970 (familiar to anyone who's spent any time on Unix), but gtkcookie translates those dates into human-readable expiry dates in the final column. Editing cookies To edit a cookie, double-click on the cookie, and a cookie edit dialogue will pop up. You'll notice that the date, in seconds since the epoch (the epoch is 1 Jan 1970), is not an editable field, whereas the human-readable date is. Follow the format presented in the edit dia- logue box, and as you edit the human-readable date, the expiry date in seconds since the epoch will update itself. Please note (as repeated in the bugs section below) that although dates later than 2038 are supposed to present problems, (you'll see the date in seconds since the epoch become -1) dates on or after 2036 seem to present problems. I'm still looking into this. Searching for text strings Under the Edit menu, select Find. Type in a string or substring that you wish to find, and press the Find button. If the string or sub- string is found anywhere in a cookie, that cookie will become selected, and the view will scroll to that cookie, if necessary. Pressing Find again will search for the next instance, or pop up a "not found" dialogue box if the string wasn't found. In its current version, gtk- cookie isn't yet smart enough to re-start a search from the top of the cookie list, so if you need to search from the top, hightlight the first cookie, and then do your search. Deleting cookies Right click on a cookie, and select "Delete" from the popup menu, or click on the cookie and press "Del" on your keyboard. Creating cookies Press the "Create Cookie" button. A cookie with dummy values will be added to the cookie list, and the "Edit Cookie" dialogue box will pop up so that you can edit the new cookie to your liking. Note that even if you press "Cancel" immediately after creating a new cookie, the new cookie, with its dummy values, will still be in the list. You'll have to delete the cookie manually. FILES
~/.netscape/cookies The Netscape cookie file in your home directory SEE ALSO
None NOTES
None AUTHOR
Manni Wood: mwood@sig.bsh.com or pq1036@110.net BUGS
1. The "Edit Cookie" dialogue has problems with on-the-fly conversion of human-readable dates to the number of seconds since the epoch for dates later than 2036. For some reason, despite the fact that the date is supposed to overflow in 2038, the C function strptime flubs up the conversion for dates larger than 1036. Unfortunately, this means that when you edit a cookie whose expiry date is after 2036, the edit dialogue box shows the number of seconds since the epoch as -1. There is currently no workaround to this problem, besides moving the date back 2 years. 2. Although the "find" feature is supposed to always highlight and scroll to any found item, sometimes, the item becomes highlighted, but is outside the current view. 3. The file open and save dialogues don't show directories beginning with a dot (such as .netscape!) but typing such directory names manu- ally will work. 4. Double-clicking in the scroll bar will pop up the "Edit Cookie" dialogue box for the currently highlighted cookie. 5. Editing the cookie file while Netscape is running is futile, because Netscape will re-write the cookie file when you exit Netscape, based on what's in its memory, not what's in the cookie file. A popup menu in my programme warns you of a running netscape... unless you're running Netscape 4.5. Netscape 4.5 doesn't seem to create the same lock file that earlier Netscapes used to. October 1998 gtkcookie(1)
All times are GMT -4. The time now is 01:36 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy