Sort output is different with Corn


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Sort output is different with Corn
# 1  
Old 11-16-2010
Question Sort output is different with Corn

Hi,

I am sorting a file, but getting different output with crontab.

input file-file
z
Z
x
X
y
Y

when I sort manually
sort file
x
X
y
Y
z
Z

crontab output
X
Y
Z
x
y
z

---
output required: (as manual sort)
x
X
y
Y
z
Z
# 2  
Old 11-16-2010
Cron run in a restricted environment.
Please consider using POSIX local : see
https://www.unix.com/shell-programmin...ting-unix.html
# 3  
Old 11-16-2010
Please post the script, stating what Shell the script was designed for.
Please state what Operating System and Shell you are using.
If your /etc/profile or .profile file changes the locale please post the lines from those files which change the character set.
# 4  
Old 11-16-2010
What do you call sort "manually" ?

---------- Post updated at 16:17 ---------- Previous update was at 16:05 ----------

if ksh you can always:
Code:
us99:/export/home/vbe $ cat sort0001                                           
A
a
b
B
c
C
Z
z
y
Y
x
X
us99:/export/home/vbe $ sort -f sort0001|tr '[A-Z] [a-z]' '[a-z] [A-Z]'
a
A
b
B
c
C
x
X
y
Y
z
Z

---------- Post updated at 16:28 ---------- Previous update was at 16:17 ----------

Heck, just realized the title "Corn" was for cron and not korn (ksh)...

Last edited by vbe; 11-16-2010 at 11:30 AM.. Reason: typos
# 5  
Old 11-16-2010
Quote:
Heck, just realized the title "Corn" was for cron and not korn (ksh)...
Totally off topic. LOL.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Any way to sort ps output based on STIME?

Hi, This is one of the thing that am looking for when I post the question on the ps wrapper. It has since been closed as it has taken me too long to post an example. I have replaced some of the original content of the ps output. uname -a = SunOS <hostname> 5.11 11.3 sun4v sparc sun4v ... (1 Reply)
Discussion started by: newbie_01
1 Replies

2. Shell Programming and Scripting

Need to sort an output

with a command i get a long list (example) and the entrys are intended. DName=AAAAA DName=AAAAA lba=838,860,800 label=ftw_1 DName=BBBBB DName=BBBBB lba=838,860,800 label=ftw_2 DName=CCCCC ... (3 Replies)
Discussion started by: Serano
3 Replies

3. Shell Programming and Scripting

sort ps output in seconds

Now I van sort in hour-minute-second. I need in seconds ps -eo pid,etime,args --sort=start_time | grep bash Sample Output 15064 03:23 -bash I need in 03:23 in seconds (1 Reply)
Discussion started by: anil510
1 Replies

4. Shell Programming and Scripting

Sort and output to different files

Hi all! I have a comma delimited file and I'm sorting it based on fields 6, 8 and 10. The following does the job: sort -t, -nk6,10 unsorted.txt -o sorted.txt What I need to do now is to write every row containing same values on fields 6, 8 and 10 to a different file. Any ideas on how to do... (2 Replies)
Discussion started by: Tr0cken
2 Replies

5. UNIX for Dummies Questions & Answers

Schedule a corn job

Hi, I new to cron job... I need to schedule a job that runs on a particular day at a specific time say for example need to send a test mail at around 2:30PM on wed 10th August i have used the below syntax, but the job was not executed. 30 14 * * * echo "message from UNIX... (3 Replies)
Discussion started by: ch33ry
3 Replies

6. UNIX for Dummies Questions & Answers

Sort fdupes output by size

Hi I have a file that is a fdupes output. I'd like to sort the duplicated file by size. The format file is the following: 5996544 bytes each: /path1/to/file1.jpg /path2/to/file1.jpg /pathx/to/file1.jpg ... random number of lines /path999/to/file1.jpg 591910 bytes each:... (2 Replies)
Discussion started by: AdminLew
2 Replies

7. Shell Programming and Scripting

sort output

this one is a bit tricky: host16 /etc/passwd changed Thu Jan 3 16:39:48 host3 /etc/group changed Thu Jan 3 16:39:48 host2 /etc/services changed Thu Jan 3 16:39:48 host10 /etc/group changed Thu Jan 10 09:59:01 host11 /etc/group changed Thu Jan 3 18:55:38 host17 /etc/group changed Thu Jan... (9 Replies)
Discussion started by: funksen
9 Replies

8. UNIX for Dummies Questions & Answers

pause needed for corn shell

I need a user pause for a script file, like the pause command in dos. please help I thought it was the corn shell it is csh. (7 Replies)
Discussion started by: dennysavard
7 Replies

9. UNIX for Dummies Questions & Answers

how to sort and arrange an output

ok so I have a list of names that end in either ot,om,oa. So for example DETOT MANOA DET0M DET0A MANOT SEAOT etc... I want to be able to group this list by OT, OM, OA and have the output have some headers like this and be alphabatized and if possible be in colums instead of like... (10 Replies)
Discussion started by: llsmr777
10 Replies

10. UNIX for Dummies Questions & Answers

CORN job

Hello, How can i check? How many corn jobs are running? Thanks Raghu.K (1 Reply)
Discussion started by: raghuk2
1 Replies
Login or Register to Ask a Question