Operating System Shell Scripting/Programs on Linux
Linux Shell Scripting programs
Sunday, 17 June 2012
Write a shell script to count number of spaces in a file.
count=0
space
for i in `cat a.sh`
do
if [ $i != " " ]
then
count=`expr $count + 1`
else
space=`expr $space + 1`
fi
done
echo $space
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment