Solved

Script with messages Cannot open -n

Posted on 2011-09-16
4
654 Views
Last Modified: 2013-11-17
Hi experts.
I have the following question.

The following statement  gave the following "Cannot open" mesages in aix 5.3

sort -i /home/oracle/dba/lists/list+size -o /home/oracle/dba/lists/sortedlist -n -k 1,1

sort: 0653-655 Cannot open -n
sort: 0653-655 Cannot open -k
sort: 0653-655 Cannot open 1,1
0
Comment
Question by:LindaC
4 Comments
 
LVL 48

Assisted Solution

by:Tintin
Tintin earned 25 total points
ID: 36551497
Options need to come first.

sort -n -k1,1 -i /home/oracle/dba/lists/list+size -o /home/oracle/dba/lists/sortedlist
0
 
LVL 21

Assisted Solution

by:Papertrip
Papertrip earned 25 total points
ID: 36551498
sort -i -n -k 1,1 -o /home/oracle/dba/lists/sortedlist /home/oracle/dba/lists/list+size

Open in new window

0
 
LVL 68

Accepted Solution

by:
woolmilkporc earned 450 total points
ID: 36551510
Hi,

options must precede filenames.


sort -i -n -k1,1 /home/oracle/dba/lists/list+size -o /home/oracle/dba/lists/sortedlist

or

sort -i -k1,1n /home/oracle/dba/lists/list+size -o /home/oracle/dba/lists/sortedlist

wmp
0
 
LVL 8

Author Closing Comment

by:LindaC
ID: 36551533
Thank you all.

Awarding woolmilkporc as was the closest to the original and was succesfully executed.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tech tip describes how to install the Solaris Operating System from a tape backup that was created using the Solaris flash archive utility. I have used this procedure on the Solaris 8 and 9 OS, and it shoudl also work well on the Solaris 10 rel…
Why Shell Scripting? Shell scripting is a powerful method of accessing UNIX systems and it is very flexible. Shell scripts are required when we want to execute a sequence of commands in Unix flavored operating systems. “Shell” is the command line i…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now