J
Jose Luis
Hi,
How can I get the same sort for "foo.txt" in perl and unix sort?
<<snip>>
indra@bhsciences:/tmp$ cat foo.txt
1 2
10 1
indra@bhsciences:/tmp$ cat sort.pl
open my $fh, shift;
my @s1 = <$fh>;
print sort @s1;
indra@bhsciences:/tmp$ perl sort.pl foo.txt
1 2
10 1
indra@bhsciences:/tmp$ sort foo.txt
10 1
1 2
indra@bhsciences:/tmp$ uname -a
Linux bhsciences 2.6.32 #3 SMP Tue May 11 10:48:46 CEST 2010 x86_64 GNU/Linux
<<snip>>
Thanks in advance,
Jose Luis
How can I get the same sort for "foo.txt" in perl and unix sort?
<<snip>>
indra@bhsciences:/tmp$ cat foo.txt
1 2
10 1
indra@bhsciences:/tmp$ cat sort.pl
open my $fh, shift;
my @s1 = <$fh>;
print sort @s1;
indra@bhsciences:/tmp$ perl sort.pl foo.txt
1 2
10 1
indra@bhsciences:/tmp$ sort foo.txt
10 1
1 2
indra@bhsciences:/tmp$ uname -a
Linux bhsciences 2.6.32 #3 SMP Tue May 11 10:48:46 CEST 2010 x86_64 GNU/Linux
<<snip>>
Thanks in advance,
Jose Luis