Hi
Can anyone what I am doing wrong while using cut command.
for f in *.log
do
logfilename=$f
Log "Log file Name: $logfilename"
logfile1=`basename $logfilename .log`
flength=${#logfile1}
Log "file length $flength"
from_length=$(($flength - 15))
Log "from length $from_length"
logfile_date=`echo $logfile1 | cut -c ${from_length}-8`
Log "Logfile date with stringlength $logfile_date"
done
Getting error in cut command for a file as
INT_put_daily_stock_tax_to_ML_20110520_002258
I want use cut command.
The error is showing
+ + echo INT_put_daily_stock_tax_to_ML_20110520_002258
+ cut -c 30-8
cut: Bad range "30-8" in list
Don't know what is wrong when used cut command.