Write A shell script that takes a command –line argument and reports on whether it is directry ,a file,or something else - Code

Latest

programs

Thursday, October 6, 2011

Write A shell script that takes a command –line argument and reports on whether it is directry ,a file,or something else


a) Write A shell script that takes a command –line argument and reports on whether it is directry ,a file,or something else
b) Write a shell script that accepts one or more file name as a arguments and converts all of thenm to uppercase,provided they exits in the current directory
c) Write a shell script that determines the period for which a specified user is working on the system

echo "Enter a file name:"
read f
if [ -f $f ]
then
            echo "File"
elif [ -d $f ]
then
            echo "Directory"
else
            echo "Not"
fi


Output:

Directory

No comments:

Post a Comment