Script(s)

technology as-is

August 17, 2015
by gchandra
0 comments

Error : bash: 08: value too great for base (error token is “08”)

Error Message : bash: 08: value too great for base (error token is “08”)  or  bash: 09: value too great for base (error token is “09”) This error message is seen when an arithmetic operation is performed on numbers which … Continue reading

August 17, 2015
by gchandra
0 comments

Linux Tip : Convert date time to Unix Time (Epoch)

Simple script to covert  regular  date time to unix epoch time format  (UTC) $dat=’01/02/2015′ #If date is passed without time then its assumed as midnight  00:00:00 for that day. $sepoch=$(date “+%s” -d “$dat”) $echo $sepoch will return 1420156800 #If you … Continue reading

August 17, 2015
by gchandra
0 comments

Linux Tip : Split Date into Day, Month, Year

Easy way to split date into  Day, Month, Year  in Linux.  This code was tested using Bash shell. $dat=’13/2/2015′ sday=$(date -d “$dat” ‘+%d’) smonth=$(date -d “$dat” ‘+%m’) sfourdigityear=$(date -d “$dat” ‘+%Y’) stwodigityear=$(date -d “$dat” ‘+%y’) echo $sday  will display   02 echo … Continue reading