Please support our Community Introductions advertiser: Programming Forums
Views: 1167 | Replies: 7
![]() |
•
•
Join Date: Jun 2005
Location: Cambridge, MA
Posts: 1,330
Reputation:
Rep Power: 7
Solved Threads: 44
•
•
Join Date: Jul 2005
Posts: 4
Reputation:
Rep Power: 0
Solved Threads: 0
I need to write a shell script that..
Asks the user to input a file name and then tests to see if that
file exists.
If the file exists, then they should be told EXACTLY the following:
"Yes it's just where you thought it was. It's name is [filename]"
If the file does NOT exist, they they should be told EXACTLY:
Sorry, it's just not there. It's name was [filename]
... iam supposed to use if then else read scripts...
can you help me out ??
thanks
sara
Asks the user to input a file name and then tests to see if that
file exists.
If the file exists, then they should be told EXACTLY the following:
"Yes it's just where you thought it was. It's name is [filename]"
If the file does NOT exist, they they should be told EXACTLY:
Sorry, it's just not there. It's name was [filename]
... iam supposed to use if then else read scripts...
can you help me out ??
thanks
sara
•
•
Join Date: Jul 2005
Posts: 4
Reputation:
Rep Power: 0
Solved Threads: 0
#!bin/sh
#this program tests wheter a file exists or not
echo"enter a file"
if[-e $file]
then
echo"Yes it's just where you thought it was. It's name is [filename]"
elif [-e $file]
then
echo"Sorry, it's just not there. It's name was [filename]
fi
i am tryig to figure out how to put the read statements..what am i missing??
thanks
#this program tests wheter a file exists or not
echo"enter a file"
if[-e $file]
then
echo"Yes it's just where you thought it was. It's name is [filename]"
elif [-e $file]
then
echo"Sorry, it's just not there. It's name was [filename]
fi
i am tryig to figure out how to put the read statements..what am i missing??
thanks
•
•
Join Date: Feb 2002
Location: Lawn Guylen, NY
Posts: 11,072
Reputation:
Rep Power: 33
Solved Threads: 118
Hey there ... check out our linux forum at http://www.daniweb.com/techtalkforums/forum12.html
This forum is reserved to introduce and welcome new members to the community.
This forum is reserved to introduce and welcome new members to the community.
Dani the Computer Science Gal
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)






Linear Mode