Question about error reporting


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Question about error reporting
# 1  
Old 08-25-2003
Question about error reporting

hi all,
i've got a script that takes in what a user enters (multiple entries) and then joins them all together and appends this to a file. what i want to happen now is the terminal should display "record saved" if the save to the file is successful, if it isn't just display the standard unix error message.

also in another script i am checking to see if some files actually exist that are needed in that script. i am using find to see if these files are there or not. it works fine, but say if the file i am looking for is not there and it's the third file that has been searched for, then the names of the two files that have already been found are printed out before the error message. is there a way to just pront out the error message?

cheers, waz.
# 2  
Old 08-25-2003
append "&2 >/usr/error.log" at the end of the command, to log all the error messages to a file(/usr/error.log) and at the end of the execution use "cat /usr/error.log" to display only the system generated errors.
# 3  
Old 08-25-2003
The problem with the find command is that it returns an error code of 0 if the search was successful ... and the search is successful whether or not the file is found.

What about, before you need the file, using something like:

if [ -e your_file ]; then
...
fi
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. AIX

How to disable an error reporting ???

Hi A few days ago I attached an usb external disk to a server running AIX, then I removed it without typing any commands. Now, the server can't find the usb device and it keeps reporting the errors every 3 hours, like this 55479D40 0112080017 T H usbms0 ADDITIONAL INFORMATION... (2 Replies)
Discussion started by: bobochacha29
2 Replies

2. SCO

du and dfspace reporting

Hi, I am using SCO UNIX version 6.0.0 release 5. I am using du and df space to see the used space in the / partition. I am using du -k option to get count in 1024 k so that it directly makes kb. In dfspace I subtracted the used mb from total size mb which should be the used space and then... (40 Replies)
Discussion started by: dextergenious
40 Replies

3. UNIX for Dummies Questions & Answers

Error reporting script

I am very new to unix/linux and am unsure how to do the following tasks within my script 1) append a log file and add a timestamped echo "Error occured" to it, if posibble to print it to file and on screen at the same time would be even better. 2) As my main script will be calling on a couple... (1 Reply)
Discussion started by: shamwick
1 Replies

4. Solaris

sar command not reporting

I am running Solaris 10 in a sparc environment. I have the sys crontab setup to use sar to gather data and report it. My sys crontab entry looks like this: 0,5,10,15,20,25,30,35,40,45,50,55 * * * 0-6 /usr/lib/sa/sa1 20,40 8-17 * * 1-5 /usr/lib/sa/sa1 5 18 * * 1-5 /usr/lib/sa/sa2 -s 8:00 -e... (2 Replies)
Discussion started by: RobSand
2 Replies

5. UNIX for Advanced & Expert Users

reporting NS-12564 error as ORA-12564

Hi My client connection to RAC Oracle Release 10.2.0.4.0 database suddenly stopped working. ACPT_1 - works but not with OEM. ACPT_2 - does not work at all. Getting error ORA-12564: TNS:connection refused Any ideas very much appreciated Thanks ACPT_1 = (DESCRIPTION = ... (4 Replies)
Discussion started by: zam
4 Replies

6. Shell Programming and Scripting

Reporting SU and Failedlogins

Hi:- I am working on an audit report that produces a monthly summary of account activity on a particular AIX host. I am struggling with su activity and failed logins as these tend to come back with more then a month's data. Is there a easy way that these files can be rotated/cleaned out on a... (1 Reply)
Discussion started by: janet
1 Replies

7. UNIX for Dummies Questions & Answers

Progress reporting

Hi everyone, I'm completely new to the board and to UNIX and I have the following question regarding a script I am building. I am trying to copy an entire directory into a new directory and I was wondering if there is any way of printing on screen a progress report, for example a percentage. It... (9 Replies)
Discussion started by: Ypnos
9 Replies

8. UNIX for Dummies Questions & Answers

Reporting

I have to do a lot of reporting for the company that I work for and was wondering if anyone had suggestions for a way to create professional looking reports. I currently use Filepro so much that I rarely see the shell. Any help is appreciated. (3 Replies)
Discussion started by: Mike11
3 Replies
Login or Register to Ask a Question