Newbie to bash
anybody know the problem it seems quite easy to solve but I just can't figure it out myself!
basically the command I am making does something to the arguments that the user enters, these arguments are filenames [THIS IS FOR AN ASSIGNMENT SO I CANT DISCUSS CONTENTS] lets just say it lists the files for example sake
there is no limit to the number of files that the user can type THE CODE (MAIN BIT THAT HAS PROBLEM)
if [ -e "$*" ]
then
ls "$*"
echo "your files are listed"
else
echo "file does not exist"
exit 0
fi
basically the if statement doesnt work for some reason
i want it so that the user can type in as many arguments as they want
and the if statement will check if all the arguments (files) exist
so far when i just type in 1 argument it checks if it exists
but when i type in more than 1 then it pops up with error "too many arguments" and the error message that it doesnt exist
HELP WOULD BE APPRECIATED :)
and if you feel that you will be helping me cheating dont worry the main code is okay it works but its just this validation bit!