LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-23-2009, 01:21 PM   #1
musician
LQ Newbie
 
Registered: Jul 2009
Posts: 1

Rep: Reputation: 0
cat FILE|sort +1 -n Returns ... +1: No such file or directory


These also fail
> sort +1 -n /tmp/trash
sort: open failed: +1: No such file or directory
> sort +1 -n < /tmp/trash
" "

The above commands fail in linux, but not Solaris.

> uname -a
Linux bogushost 2.6.18-128.1.1.el5 #1 SMP Mon Jan 26 13:58:24 EST 2009 x86_64 x86_64 x86_64 GNU/Linux

> which sort
/bin/sort

> alias sort
sort: alias not found

> cat /tmp/trash
Greg 54646
Fred 47848

I'm most interested in getting the syntax in the Subject: to work.
I want to sort numerically on the 2nd column. I read that sort uses tmp space, so I set $TMP and $TMPDIR to /tmp, which exists and is writable, no joy.

Thanks.
 
Old 07-23-2009, 01:28 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Hi, welcome to LQ!

That's because Solaris accepts the old deprecated syntax.

Use -k 2 instead of +1


and cat on one file is mote:

sort -k2,2n file > newfile
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
cat file over ssh and put it into log file sinister1 Programming 2 04-24-2009 12:54 AM
cat: /etc/udev/rules.d/70-persistent-net.rules: No such file or directory rcg1984 Linux From Scratch 2 09-17-2008 07:02 AM
LFS 6.2 Ch. 6.14 - 2nd Coreutils test returns "/bin.bash: No such file or directory" 0graham0 Linux From Scratch 2 08-23-2007 06:32 PM
filesize limit on 'cat $file | sed > $file' drkstr Linux - Software 2 07-10-2006 02:47 AM
trying to redirect text to a file to cat at later point. says file doesn't exist. dr_zayus69 Programming 1 10-02-2005 08:10 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:48 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration