Tuesday 21 April 2015

Write a shell program to create a files associated with each command line.

This shell program will accept a variable number of command line arguments and create a new file associated with each command line argument . This program uses touch command to create file if not exiests else creates new file. 


echo "No of files entered are:$#"
echo "*********"
if [ $# == 0 ];
then
echo "No files to create"
else
for var in $@
do
touch $var
echo "File $var created successfully...!"
done
fi




No comments:
Write comments

Featured post

List of Universities in Karnataka offering M.Sc Computer Science

The post-graduate programme in Computer Science (M.Sc Computer Science) contains two academic years duration and having a four semesters....

Popular Posts

Copyright @ 2011-2022