dorinda
asked on
Format an environment variable
I am using the following command in a bourne shell script: lic=`ps -ef|grep runcobol|wc -l|cut -c6-9`
It returns a numeric number, for example 14. Is there a way to have it return the number as 4 digits zero filled? For example "0014"
It returns a numeric number, for example 14. Is there a way to have it return the number as 4 digits zero filled? For example "0014"
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
a="000"
echo $a$lic |rev |cut -c1-4|rev