I intend to write a script something like this:
rundate=20030623
EVAL_YEAR=`cut -c1-4 $rundate`
EVAL_MMDD=`cut -c5-8 $rundate`
echo "rundate $rundate"
echo "EVAL_YEAR $EVAL_YEAR"
echo "EVAL_MMDD $EVAL_MMDD"
I need the year and the monthdate in two different variables, so was trying to use cut.
but cut seems to think 20030623 is a file and not a string of text chars.
Is there a better way of acheving the result.
Thanx
rundate=20030623
EVAL_YEAR=`cut -c1-4 $rundate`
EVAL_MMDD=`cut -c5-8 $rundate`
echo "rundate $rundate"
echo "EVAL_YEAR $EVAL_YEAR"
echo "EVAL_MMDD $EVAL_MMDD"
I need the year and the monthdate in two different variables, so was trying to use cut.
but cut seems to think 20030623 is a file and not a string of text chars.
Is there a better way of acheving the result.
Thanx