I have the following command.
perl -l -e 'print -M $ARGV[0], " days"' $testfile
It works fine, in that it gives me the correct age, and works on solaris, linux, unix, as required.
However, the format is
"1.000000394945 days."
I'd like to round this down to make the post-processing easier to something like
"1.00 days."
Any idea how one might modify this to make them whole numbers?
Use printf:
perl -l -e 'printf "%.2f days", -M $ARGV[0]' file