#Write shell script that do equivalent to cut–c 5-10 utility.
echo "Script Name : $0"
i=0
lines=`cat $1 | wc -l`
echo "No of lines in file named $1 : $lines"
while [ $i -ne $lines ]
do
line=`head -$i $1 | tail -1`
#echo $line
#cutline= `echo expr substr "$line" 5 10`
cutline=`echo $line | tail -c +5 | head -c 5`
echo $cutline
i=`expr $i + 1`
#echo $i
done
echo "Done"
See Also :
Write C program that display name of all empty file and remove from directory.
echo "Script Name : $0"
i=0
lines=`cat $1 | wc -l`
echo "No of lines in file named $1 : $lines"
while [ $i -ne $lines ]
do
line=`head -$i $1 | tail -1`
#echo $line
#cutline= `echo expr substr "$line" 5 10`
cutline=`echo $line | tail -c +5 | head -c 5`
echo $cutline
i=`expr $i + 1`
#echo $i
done
echo "Done"
See Also :
Write C program that display name of all empty file and remove from directory.
Comments
Post a Comment