Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Shell Script 1

Status
Not open for further replies.

arjagadish

Technical User
Jan 6, 2003
36
IN
A shell to accept a file name from the user
check if file exists if it exists then print the last
modified time else print error message.
 
When is your assignment due :) Quick method ...
Code:
read fname
if [ -f $fname ]
then
   ls -l $fname | tr -s "  " | cut -d" " -f6-8
else
   echo "$fname does not exist"
fi
Greg.
 
Well, it was for one of my Practical Examinations ;)

Thx a lot buddy.................. what;s ur mail ID.

Mine is jagadish@japher.com

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top