X-Git-Url: https://git.jankratochvil.net/?p=nethome.git;a=blobdiff_plain;f=bin%2Fsortn;h=ad0c7d0eb9973cf2fea118f79f8ae2fd42520d05;hp=bf87d95eb306f29bf445f87e59e9bc99d0c6bd3e;hb=11606c698522b4651509e39735fc13f96575e262;hpb=597f181523ccf1d990a699aee3c20034e3a13ecf diff --git a/bin/sortn b/bin/sortn index bf87d95..ad0c7d0 100755 --- a/bin/sortn +++ b/bin/sortn @@ -7,15 +7,15 @@ print sort { my $a=$a; my $b=$b; while ($a ne "" || $b ne "") { - $a=~s/^(\D+)//s; + $a=~s/^(\D*)//s; my $as=$1; - $b=~s/^(\D+)//s; + $b=~s/^(\D*)//s; my $bs=$1; my $rs=$as cmp $bs; return $rs if $rs; - $a=~s/^(\d+)//s; + $a=~s/^(\d*)//s; my $an=$1; - $b=~s/^(\d+)//s; + $b=~s/^(\d*)//s; my $bn=$1; my $rn=$an<=>$bn; return $rn if $rn;