1754866 Members
5687 Online
108827 Solutions
New Discussion юеВ

HP-UX to Linux question

 
SOLVED
Go to solution
Ridzuan Zakaria
Frequent Advisor

HP-UX to Linux question

Hi,

I have a script that execute "sort" command to sort a file on HP-UX. However when I try to run the script on Linux it return a different result.

Here is my input file layout called d1:
#SID:ORACLE_HOME:START:MONITOR:ORDER:SID_OWNER
dbcoemP:/oracle/v9205:Y:N:1:oracle
ABCP:/oracle/v9205:Y:N:1:oracle

On HP-UX, the following output produced when "sort d1" is executed:

#SID:ORACLE_HOME:START:MONITOR:ORDER:SID_OWNER
ABCP:/oracle/v9205:Y:N:1:oracle
dbcoemP:/oracle/v9205:Y:N:1:oracle

But on Linux, I got the following result:

ABCP:/oracle/v9205:Y:N:1:oracle
dbcoemP:/oracle/v9205:Y:N:1:oracle
#SID:ORACLE_HOME:START:MONITOR:ORDER:SID_OWNER:

As far as my script is concern "sort d1" should produce HP-UX's output.

I have tried "sort -r d1" but the output produced is not what I want.

I am trying to make sure my script can run on both HP-UX and Linux environment. Is there any workaround for this problem?

Thanks.


quest for perfections
2 REPLIES 2
Gregory Fruth
Esteemed Contributor
Solution

Re: HP-UX to Linux question

Perhaps your locale setting is different
on Linux. Check the LANG and LC_*
environment variables. On my HP-UX 11.22
machine LANG is getting set to en_US.iso88591.
If I sort the file you describe, I get results
like your Linux example. If I unset LANG or
change it to C or POSIX I get results like
your HP-UX example.
Ridzuan Zakaria
Frequent Advisor

Re: HP-UX to Linux question

Thanks Gregory.
quest for perfections