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
#!/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
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
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
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
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
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
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
#!/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
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
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
LEARN ABOUT SUNOS
ckkeywd
ckkeywd(1) User Commands ckkeywd(1)
NAME
ckkeywd - prompts for and validates a keyword
SYNOPSIS
ckkeywd [-Q] [-W width] [-d default] [-h help] [-e error] [-p prompt] [ -k pid [-s signal]] keyword [...]
DESCRIPTION
ckkeywd prompts a user and validates the response. It defines, among other things, a prompt message whose response should be one of a list
of keywords, text for help and error messages, and a default value (which will be returned if the user responds with a carriage return).
The answer returned from this command must match one of the defined list of keywords.
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 will be 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) will be displayed.
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.
-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 sig-
nal 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:
keyword Defines the keyword, or list of keywords, against which the answer will be verified.
EXIT STATUS
The following exit values are returned:
0 Successful execution.
1 EOF on input, or negative width on -W option, or no keywords from which to choose, or 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 ckkeywd is:
Enter appropriate value [keyword,[...],?,q]:
The default error message is:
ERROR: Please enter one of the following keywords: keyword,[...],q
The default help message is:
keyword,[...],q
When the quit option is chosen (and allowed), q is returned along with the return code 3.
SunOS 5.10 14 Sep 1992 ckkeywd(1)