I have bash shell script to modify string.
I want get 14040116 (YYMMDDHH) from string 44[tip] 3764d6b8ae82 2014-04-01 16:34 +0400 igor
My current script looks like
raw_info="44[tip] 3764d6b8ae82 2014-04-01 16:34 +0400 igor"
hg_date=`echo $raw_info | cut -d' ' -f 3`
hg_date=${hg_date//-/}
hg_date=${hg_date:2}
hg_hour=`echo $raw_info | cut -d' ' -f 4 | cut -d':' -f 1`
hg_rev=${hg_date}${hg_hour}
It works, but can it be shorter?