5
Contributors
7
Replies
8
Views
12 Years
Discussion Span
Last Post by xtremeathlete25
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

0

hi....im gona send you what I have so far..can you see if im remotely on the right track


thanks
sara

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

0

hi I am sahil
Just make a search in google with keyword "linux script + tutorial"
I hope u will find exactly what u need.
good luck
bye
sahil
keep in contact

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.