Hello.
I am relatively new unix/linux and am writing a script with many sub scripts. One of my choices in the script asks the user to specify a file to be edited. For this I am using the vi command. I want the user to type in a filename to be edited. However, if the user just hits enter I want vi to start as if a new file was being written.
Here is the is my if statement:
echo -n "Enter file name:"
read fname
if fname=NULL
then
vi
else
vi "$fname"
fi
Any help would greatly be appreciated.