Sponsored Content
Full Discussion: checking for script errors
Top Forums Shell Programming and Scripting checking for script errors Post 46502 by Blip on Saturday 17th of January 2004 06:56:21 PM
Old 01-17-2004
checking for script errors

ok, i have a script which i use to search my process' for specific keywords and kill any process containing them. there is a prompt to enter a keyword for searching and another prompt for which user you want to search the process' of. i want the script to have something that if you entered a search term that is not found or a nonpresent user to return a "incorrect search terms, re-enter a keyword or user that can be found" and the prompt would pop back up. this would be instead of a bunch of "no such pid" or other kinds of error messages. that may be a little confusing but is there any way to do what im trying?

thanks, blip
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

unix script errors

#!/bin/ksh sqlplus -s user/passwd@remoteserver << EOF > errors2.log set pagesize 0 feedback off verify off heading off echo off select directory_nm || '/' || file_nm || '|' ||venue_id || '|' || time_id from file_control; EOF The output of this script is; ... (2 Replies)
Discussion started by: pavan_test
2 Replies

2. Programming

Errors while Compiling a PC script.

Hi all, I have created a post-C (PC) script OrdItmpopulate.pc. When I am compiling this using the “Make” command I am getting the following error. My “make” command looks like this: make -f $ORACLE_HOME/precomp/demo/proc/demo_proc.mk build EXE=OrdItmpopulate8.exe OBJS="OrdItmpopulate8.o"... (1 Reply)
Discussion started by: musavir19
1 Replies

3. Shell Programming and Scripting

checking ERRors in files

I m having trouble in a script.I need To write a script that will check for Following Errors in Logs Files,i.e files having Extension .log The erros are 2008-01-01 15:19:11,822 ERROR - ORA-01115: IO error reading block from file 51 (block # 717090) ORA-01110: data file 51:... (4 Replies)
Discussion started by: ali560045
4 Replies

4. Shell Programming and Scripting

Script to capture errors

Hello; I'm trying to write a script to capture any hardware error from logs/syslog on my SUSE 10 servers so i can be notified if we have any hardware issues such a bad fan or battery, etc.. Thanks in advance for any help (2 Replies)
Discussion started by: Katkota
2 Replies

5. Shell Programming and Scripting

Help with shell script errors

hey watsup guys i am new in the shell script world. so i need help fom you guys, i have written these two codes and they both give the same errors( expr : syntax error). Code 1 : #! /bin/sh # count1 appends an increment to a file 200 times # note that a file called numbers must be... (5 Replies)
Discussion started by: surubi_abada
5 Replies

6. Shell Programming and Scripting

Help with execution errors in script

solution found.... Please use tags for scripts, listings, and console output (2 Replies)
Discussion started by: audiolord
2 Replies

7. UNIX for Dummies Questions & Answers

How to ignore errors in script

I have a simple script that processes files. Here's a simplified example of what I'm doing: foreach t (web.*) mv $t dnw$t:e.log end foreach t (card.*) mv $t card$t:e.log end The problem is that sometimes there is no web.* file. In that case, I get an error "foreach: No match" and... (4 Replies)
Discussion started by: software5723
4 Replies

8. Shell Programming and Scripting

need help with ksh script errors

#!/bin/ksh number1="20" if then number1=$1 fi number2="1" while ] do if ] then print "FizzBuzz" elif ] then print "Fizz" elif ] then ... (3 Replies)
Discussion started by: bjhum33
3 Replies

9. Shell Programming and Scripting

Shell Script for continuously checking status of a another script running in background, and immedia

Hi, I want to write a script which continuously checking status of a script running in background by nohup command. And if same script is not running then immediately start the script...please help.. i am using below command to run script nohup system_traps.sh & but in some... (9 Replies)
Discussion started by: ketanraut
9 Replies

10. Shell Programming and Scripting

Script will keep checking running status of another script and also restart called script at night

I am using blow script :-- #!/bin/bash FIND=$(ps -elf | grep "snmp_trap.sh" | grep -v grep) #check snmp_trap.sh is running or not if then # echo "process found" exit 0; else echo "process not found" exec /home/Ketan_r /snmp_trap.sh 2>&1 & disown -h ... (1 Reply)
Discussion started by: ketanraut
1 Replies
ckuid(1)							   User Commands							  ckuid(1)

NAME
ckuid, erruid, helpuid, valuid - prompts for and validates a user ID SYNOPSIS
ckuid [-Q] [-W width] [-m] [-d default] [-h help] [-e error] [-p prompt] [ -k pid [-s signal]] /usr/sadm/bin/erruid [-W width] [-e error] /usr/sadm/bin/helpuid [-W width] [-m] [-h help] /usr/sadm/bin/valuid input DESCRIPTION
The ckuid utility prompts a user and validates the response. It defines, among other things, a prompt message whose response should be an existing user ID, text for help and error messages, and a default value (which are returned if the user responds with a <RETURN>). All messages are limited in length to 70 characters and are formatted automatically. Any white space used in the definition (including NEW- LINE) is stripped. The -W option cancels the automatic formatting. When a tilde is placed at the beginning or end of a message definition, the default text is inserted at that point, allowing both custom text and the default text to be displayed. If the prompt, help or error message is not defined, the default message (as defined under NOTES) is displayed. Three visual tool modules are linked to the ckuid command. They are erruid (which formats and displays an error message), helpuid (which formats and displays a help message), and valuid (which validates a response). These modules should be used in conjunction with FML objects. In this instance, the FML object defines the prompt. OPTIONS
The following options are supported: -d default Defines the default value as default. The default is not validated and so does not have to meet any criteria. -e error Defines the error message as error. -h help Defines the help messages as help. -k pid Specifies that process ID pid is to be sent a signal if the user chooses to abort. -m Displays a list of all logins when help is requested or when the user makes an error. -p prompt Defines the prompt message as prompt. -Q Specifies that quit will not be allowed as a valid response. -s signal Specifies that the process ID pid defined with the -k option is to be sent signal signal when quit is chosen. If no signal is specified, SIGTERM is used. -W width Specifies that prompt, help and error messages will be formatted to a line length of width. OPERANDS
The following operand is supported: input Input to be verified against /etc/passwd. EXIT STATUS
The following exit values are returned: 0 Successful execution. 1 EOF on input, or negative width on -W option, or usage error. 2 Usage error. 3 User termination (quit). ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ SEE ALSO
attributes(5) NOTES
The default prompt for ckuid is: Enter the login name of an existing user [?,q]: The default error message is: ERROR - Please enter the login name of an existing user. If the -m option is used, the default error message is: ERROR: Please enter one of the following login names: <List> The default help message is: Please enter the login name of an existing user. If the -m option is used, the default help message is: Please enter one of the following login names: <List> When the quit option is chosen (and allowed), q is returned along with the return code 3. The valuid module will not produce any output. It returns 0 for success and non-zero for failure. SunOS 5.10 14 Sep 1992 ckuid(1)
All times are GMT -4. The time now is 09:58 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy