Sunday, 10 August 2014

Write a shell script that accept one or more filenames as argument and convert all of them to uppercase, provided they exist in current directory.


for f in $*
do
if [ -e $f ]
then
cat $f|tr "[a-z]" "[A-Z]">tmp
mv tmp $f
else
echo "File $f does not exist"
fi
done

0 comments:

Post a Comment

 
- |