help needed with script that gets a filename as argument (with an if/else statement)

Hi,

I am trying to create a script just to study BASH scripting, but I have some problems.

I need to create a script that gets a filename as an argument. The script should behave as follows:
� If the given file name already exists, inform the user and quit.
� If the given file name does not exist, create an empty file by that name and inform the user.

This is my start:

#!/bin/sh
echo "type in a filename:"
read $FILENAME

if 

....

else

#filename that does not exist is created
echo "The filename $FILENAME does not exist, creating empty file $FILENAME"
touch $FILENAME

if [ -f $file ]
    ...
else
    touch $file

man test has a few more checks for files, variables, ....

Hi,

Thanks for the help I found out after trying and using google that this is the way to do it:

#!/bin/sh
echo "Please type in a filename:"
read filename
if
        [ -f ./$filename ];
then
        #a simpele display message that the file exist
        echo "file exists"
else
        #this part creates the file if the inputfilename does not exist
        echo "file does not exist, file is created"
        touch $filename
fi