Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error messages in unix

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hello!

How can I represent error messages in unix inside my script. For example I want to concatenate 2 files: file1 and file2. I asked the user to input the 2 files to be concatenated. If the user inputs a non existant file, an error message: cannot find file will occurr.... I want to be able to detect this error message because I want to ask the user again to re enter the filename....

-Jared
 
if [ ! -f $file ]
echo "file not found"
fi ***************************************
Party on, dudes!
[cannon]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top