Shell script to format date in yyyy.mm.dd format
#!/bin/bash year=2012 for (( c=1; c<=12; c++ )) do month=$(printf "%02d" $c) for (( d=1; d<=15; d++ )) do day=$(printf "%02d" $d) echo $year.$month.$day done done
Linux, Solaris, Scripting, Testing, QA, Database, Puzzles ...
#!/bin/bash year=2012 for (( c=1; c<=12; c++ )) do month=$(printf "%02d" $c) for (( d=1; d<=15; d++ )) do day=$(printf "%02d" $d) echo $year.$month.$day done done
Posted by Vishnu Agrawal at 10:57 PM
Labels: shell scripting
No comments:
Post a Comment