in reply to Re^2: Separating big numbers with commas
in thread Separating big numbers with commas
How can I embed that into an UNIX Korn shell script?Can't you sprintf to a variable, comma-munge it, and then print that?
$x = sprintf "%02d\/%02d\/%04d\ %02d\:%02d", $MM +1 , $DD , $YY + 1900 +, $hh, $mm; $x =~ s/(\d)(?=(\d{3})+(\D|$))/$1\,/g; print $x;
You could lose the interim variable on the way to print, but it's easier to follow as above.
-QM
--
Quantum Mechanics: The dreams stuff is made of
In Section
Seekers of Perl Wisdom