Change the Permission of a User Specified File > Unix Shell Programming - counter
Sponsored Links


Popular Links


List of Abbreviations

National Highways in India

States & Union Territories of India

Currency of All Countries

Change the Permission of a User Specified File > Unix Shell Programming

You are Here: Home > Computer Subjects > Unix Shell Programming…

 

Change the Permission of a User Specified File | Change the permission of a file by taking file name as user input

Code:

clear

if test -f $1
then
	echo "Do you want to change the permission of the file " $1
	echo
	echo "Press 'Y' to Continue or 'N' to Cancel"
	read ch

	if test $ch = y -o $ch = Y
	then
		chmod 000 $1
		echo "The Permission has been changed!!!"
	elif test $ch = n -o $ch = N
	then
		echo
	else
		echo "Please Enter a valid choice"
	fi
else
	echo "The File does not exist!!!"
fi

Click Here to Find Latest Jobs and Current Affairs

Updated: June 1, 2013 — 4:33 am
© 2016. All Rights Reserved. WikiIND.com