Using the command:
CURRTIME=`date "+%Y%m%d%k%M%S"`
I can get the current time string such as “20120827141534”. I want to use this string to make a file . But when it is before 10 a clock, it can’t runs well. The string will be spearate Because the the hour string has only one digit with space before it. CURRTIME will be like this:20120827 41534.
How can I deal with it?
Use
%Hinstead of%k:%kis space padded (obviously). but%Hadds a padded 0.