using sed print the lines that have more than 10 characters, of each file. the files arre given as parameters. i did this:

#!/bin/sh

a=0
zece=10
if [ $# -eq 0 ]
then echo "An error occured regarding the parameters. "
else
for i in $@
do
if [ ! -e $i ]
then echo "The file does not exist. "
else
cat $i | cut -c 0- | while read l
do
echo $l > andrei.txt
a=`wc -c andrei.txt`
if [ $a -gt $zece ]
then sed -f exe.txt andrei.txt
fi
a=0
done
fi
done
fi

but i get an error to the last if: too many parameters. what is wrong?
Edit/Delete Message

problem solved a=`cat andrei.txt | wc -c`

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.