Sponsored Content
Special Forums UNIX and Linux Applications How to automatically detect command failure Post 302188712 by krishmaths on Thursday 24th of April 2008 05:22:28 AM
Old 04-24-2008
You can write a function, say "handle_error" where you can define the if condition, and execute this function whenever you need it.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

failure of at command

This is my first posting. I am not a very sophisticated UNIX user. I am trying to have an existing control string trigger another process at 4:00 p.m. My command looks like this on System V.4 UNIX. at -f /scriptname 16:00 I have added the users to /etc/cron.d/at.allow and at.deny is... (5 Replies)
Discussion started by: DKuester
5 Replies

2. UNIX for Dummies Questions & Answers

find command to detect installations

Hi I'm wondering how I can find all the files which were installed on certain date? For example: I'm looking for alle the files which were installed on the 11.09.06 on the system. Does somebody know how to do this? Thanks Reto (2 Replies)
Discussion started by: goldenglobe
2 Replies

3. Shell Programming and Scripting

copy command failure

A cp command failure occured on our production system. A shell script copies a source file to a temporary directory - cp <source file on mount point 1> <dest path on mount point 2> The same script ran successfully for another file, about 3mins after the failure. The script did not have a... (1 Reply)
Discussion started by: mynix
1 Replies

4. Solaris

make command failure

Hi After downloading and compiling new ntp source for Solaris 10 I used the make command on the ntp directory. I received the following output: bash-3.00# make (bk version) >/dev/null 2>&1 && \ cd . && \ x=`bk -R prs -hr+ -nd:I: ChangeSet` && \ y=`cat version... (2 Replies)
Discussion started by: shaife720
2 Replies

5. AIX

how to detect removable disks or volume in AIX using command

Hi I am new to AIX and any help regarding the same would be really appriciated, thanks In advance. My priority issue is how to detect from command line that the volume / disk on AIX machine is a USB or removable disk /volume and if possible can we list out details for that disk / volume (1 Reply)
Discussion started by: mak_mailbox
1 Replies

6. Red Hat

How to detect kind of command for root only?

Dear all, Please help me clarify why i cannot run command in /sbin directory (ex: /sbin/fdisk -l )! I've checked permission on files which belong /sbin directory with execute permission. However, i still cannot run with normal user. Sorry for my English. thanks all, (5 Replies)
Discussion started by: all4cfa
5 Replies

7. Shell Programming and Scripting

Using grep command to detect presence of script run

i have this line of code on a korn shell script to detect the presence of script run: ISRUNNING=`ps -eaf -o args | grep -i sfs_load_file.ksh | grep -v grep | wc -l` sometimes this returns either 1, 2, or 3. when it returns 2 or 3 that tells us that there are more than 1 script of... (8 Replies)
Discussion started by: wtolentino
8 Replies

8. Shell Programming and Scripting

Tomcat failure detect via shell

Team, I am able to get ERROR message from my shell script, but sometime few severe error happen that tomcat server not started or not responding. How do we can detect it via shell script ? here is my snippet I used for my case tail -n0 -F $catalinaPath | while read line; do if echo... (0 Replies)
Discussion started by: Ghanshyam Ratho
0 Replies

9. Shell Programming and Scripting

Htop - How to detect exact command running at background

Hello, I am running a python file from terminal and I wish to see which code is running at background. When I use htop, I see just a few commands, unable to see entire command. htop > report nano report Output: ^ Following parts of ffmpeg line is not shown by htop. Just showing... (7 Replies)
Discussion started by: baris35
7 Replies

10. Ubuntu

Detect and run command upon mouse movement

I am trying to find a way to run a command upon any movement of a mouse. The 1st statement shows the mouse co-ordinates. So it can detect mouse movement. xinput test 9 First list input devices: $ xinput list If possible, I would like to use it in a bash script. (2 Replies)
Discussion started by: drew77
2 Replies
PAPI_event_code_to_name(3)					       PAPI						PAPI_event_code_to_name(3)

NAME
PAPI_event_code_to_name - Convert a numeric hardware event code to a name. SYNOPSIS
Detailed Description @par C Interface: int PAPI_event_code_to_name( int EventCode, char * EventName ); PAPI_event_code_to_name is used to translate a 32-bit integer PAPI event code into an ASCII PAPI event name. Either Preset event codes or Native event codes can be passed to this routine. Native event codes and names differ from platform to platform. @param EventCode The numeric code for the event. @param *EventName A string containing the event name as listed in PAPI_presets or discussed in PAPI_native. @retval PAPI_EINVAL One or more of the arguments is invalid. @retval PAPI_ENOTPRESET The hardware event specified is not a valid PAPI preset. @retval PAPI_ENOEVNT The hardware event is not available on the underlying hardware. @par Examples: * int EventCode, EventSet = PAPI_NULL; * int Event, number; * char EventCodeStr[PAPI_MAX_STR_LEN]; * // Create the EventSet * if ( PAPI_create_eventset( &EventSet ) != PAPI_OK ) * handle_error( 1 ); * // Add Total Instructions Executed to our EventSet * if ( PAPI_add_event( EventSet, PAPI_TOT_INS ) != PAPI_OK ) * handle_error( 1 ); * number = 1; * if ( PAPI_list_events( EventSet, &Event, &number ) != PAPI_OK ) * handle_error(1); * // Convert integer code to name string * if ( PAPI_event_code_to_name( Event, EventCodeStr ) != PAPI_OK ) * handle_error( 1 ); * printf( "Event Name: %s0, EventCodeStr ); * See Also: PAPI_event_name_to_code PAPI_remove_event PAPI_get_event_info PAPI_enum_event PAPI_add_event PAPI_presets PAPI_native Author Generated automatically by Doxygen for PAPI from the source code. Version 5.2.0.0 Tue Jun 17 2014 PAPI_event_code_to_name(3)
All times are GMT -4. The time now is 02:25 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy