Sponsored Content
Full Discussion: Sort function UNIX bug ???
Top Forums Shell Programming and Scripting Sort function UNIX bug ??? Post 302743473 by kykyboss on Wednesday 12th of December 2012 11:50:18 PM
Old 12-13-2012
echo $LANG

Code:
en_US.UTF-8

---------- Post updated at 11:38 PM ---------- Previous update was at 11:30 PM ----------

~% env

Code:
USER=pilotlab
LOGNAME=pilotlab
HOME=/home/pilotlab
PATH=/usr/dt/bin:/usr/openwin/bin:/bin:/usr/bin:/usr/ucb:/usr/contrib/bin:/usr/local/bin:/usr/sbin:/usr/ccs/bin
MAIL=/var/mail//pilotlab
SHELL=/bin/tcsh
TZ=US/Eastern
LC_CTYPE=en_US.ISO8859-1
LC_COLLATE=en_US.ISO8859-1
LC_TIME=en_US.ISO8859-1
LC_NUMERIC=en_US.ISO8859-1
LC_MONETARY=en_US.ISO8859-1
LC_MESSAGES=C
SSH_CLIENT=9.49.136.160 53208 22
SSH_CONNECTION=9.49.136.160 53208 9.31.24.88 22
SSH_TTY=/dev/pts/23
TERM=xterm
DISPLAY=localhost:10.0
HOSTTYPE=sun4
VENDOR=sun
OSTYPE=solaris
MACHTYPE=sparc
SHLVL=1
PWD=/home/pilotlab
GROUP=algolab
HOST=talos
REMOTEHOST=sig-9-49-136-160.mts.ibm.com
CPLEXLICENSE=/mnts/master/cplex/cpxlicptr
LD_LIBRARY_PATH=/usr/lib:/usr/openwin/lib:/usr/sfw/lib
EDITOR=vi
MANPATH=/usr/share/man:/usr/local/man

~% echo $LANG
Code:
en_US.UTF-8

~% echo $LC_ALL
Code:
C


that did not change anything

~% sort test.txt

Code:
,Test,RSD,RSDA
,Test,RSD,RSD_Asset
,Test,RSD,RSD_Credit
,Test,RSD,RSD_Liab
,Test,RSD,RSD_Mort
,Test,RSD,RSD_Oper
,Test,RSD,VA
,Test,RSD,VA,VA_Asset
,Test,RSD,VA,VAFA
,Test,RSD,VA,VAFA,VAFA_Asset
,Test,RSD,VA,VAFA,VAFA_Credit
,Test,RSD,VA,VAFA,VAFA_Liab
,Test,RSD,VA,VA_Liab


if you sort it on your unix machine, does it sort it well ?

regards

---------- Post updated at 11:50 PM ---------- Previous update was at 11:38 PM ----------

Sorry it actually work !!!!! SmilieSmilie you found it !!!

if i execute

Code:
env LC_ALL=C sort test.txt

it work fine

Code:
,Test,RSD,RSDA
,Test,RSD,RSD_Asset
,Test,RSD,RSD_Credit
,Test,RSD,RSD_Liab
,Test,RSD,RSD_Mort
,Test,RSD,RSD_Oper
,Test,RSD,VA
,Test,RSD,VA,VAFA
,Test,RSD,VA,VAFA,VAFA_Asset
,Test,RSD,VA,VAFA,VAFA_Credit
,Test,RSD,VA,VAFA,VAFA_Liab
,Test,RSD,VA,VA_Asset
,Test,RSD,VA,VA_Liab

but if i do it in two step (like the way i tryed before)
Code:
env LC_ALL=C

then

Code:
sort test.txt

the error is there

so i guess i need to review my locals
i can take care of that thanks a lot and that is really good to know (for me at least)

regards
 

9 More Discussions You Might Find Interesting

1. Programming

sort function

do any one knows where i can find an implementation in c for the sort function (2 Replies)
Discussion started by: dbargo
2 Replies

2. Shell Programming and Scripting

Function Bug in script - need help

My script is erroring with: testtapemgr.sh: FTP_RETURNS: not found I cannot see what I am doing wrong..when it calls that function from the Volume returns function and says taht FTP_RETURNS is not found and exits out of the script. What am I not seeing here? #### Return Volume Function ... (4 Replies)
Discussion started by: gzs553
4 Replies

3. Shell Programming and Scripting

sort function in perl

Hi, here is my perl script.This script creates an array and is sorting it using the in-built sort function in perl. #!/usr/local/bin/perl my number=6; my @num_arr=(1,2,3,4,5); my @array=(23,"$number","Hello",2.345,@num_arr); #printing the array print... (2 Replies)
Discussion started by: DILEEP410
2 Replies

4. Shell Programming and Scripting

bash-function with array acting bizarre, bug?

Hello, basically what this script is supposed to do is showing a list of hosts that is given a number, that you will be able to choose from a list. A check is made to verify that the chosen number is within the array and this is where things go bad and I don't know why, bizarre. I've spent... (5 Replies)
Discussion started by: gand
5 Replies

5. Homework & Coursework Questions

Sort function -- My First Unix Homework!

1. The problem statement, all variables and given/known data: To sort a data 2. Relevant commands, code, scripts, algorithms: The data provided is saved in dummy.txt and provided in LIBSVM format, but I think this information is redundant.. +1 1:2 2:4 4:3.2 -1 2:2.1 2:2.1 ... (4 Replies)
Discussion started by: eeweepoh
4 Replies

6. Shell Programming and Scripting

Bug in Function Call

Can anybody tell me where is the bug in this below mentioned function call. #The String Search File myString="${LOCATION}/config/stringFile.txt" # Functional Usage function usage() { if ; then echo "************************************************************" ... (5 Replies)
Discussion started by: baraghun
5 Replies

7. Programming

Tweaked getpass() function gives an untraceable bug

I have customized the getpass() as follows: char* my_getpass(const char* str) { struct termios oflags, nflags; static char passwd; /* disabling echo */ tcgetattr(fileno(stdin), &oflags); nflags = oflags; nflags.c_lflag &= ~ECHO; nflags.c_lflag |= ECHONL; ... (3 Replies)
Discussion started by: royalibrahim
3 Replies

8. What is on Your Mind?

Small bug in the Quick Editor function in postbit

Hey, There was a small bug in the Quick Editor function in postbit, but I fixed it (basically a double quote was missing from an element id): <div id="post_message_$post" class="neo-message-area">$post</div> Was <div id="post_message_$post class="neo-message-area">$post</div> Should... (1 Reply)
Discussion started by: Neo
1 Replies

9. UNIX for Beginners Questions & Answers

Inconsistent results using sort function

Could you please advise on the following: I have two space-delimited files with 9 and 10 columns, respectively, with exactly the same values in column 1. However, the order of column 1 differs between the two files, so I want to sort both files by column 1, so that I can align them and... (6 Replies)
Discussion started by: aberg
6 Replies
All times are GMT -4. The time now is 03:16 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy