Sponsored Content
Top Forums Shell Programming and Scripting How to exit a shell script if a unix command does not return any value for 10 seconds? Post 302684245 by Corona688 on Thursday 9th of August 2012 10:25:21 AM
Old 08-09-2012
A hanged command doesn't return. That's what hanged means.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

using exit command in a shell script

Can it be done? If so, how? I would like a script to contain the exit command, and log me off at script completion. thanks (1 Reply)
Discussion started by: jpprial
1 Replies

2. UNIX for Advanced & Expert Users

Move command return with exit code of 2

I have a script which loads data files into Oracle and then moves each file into a 'processed' directory when each file has finished loading. Last night I found that the script was failing on the mv statement (with a return code 2) and the following message, mv: cannot access... (1 Reply)
Discussion started by: handak9
1 Replies

3. Shell Programming and Scripting

command does not return exit status due to tee

Hi, I am using /bin/sh. I want to display the stdout and stderr on the terminal as well as save it in a file, so I'm using this command. gmake all 2>&1 | tee log But even if gmake fails, it's always giving 0 as exit status, i suppose because of tee. # false 2>&1 | tee Log # echo $? 0... (2 Replies)
Discussion started by: anand_bh
2 Replies

4. Shell Programming and Scripting

Exit script if the user dosent enter any data within 5 seconds

Hello friends, Kindly help me in developing a script that asks user to enter a value and will wait for 5 seconds for the feedback. If there is no answer from the user the script will perform exit or it will continue doing something else Ex: If yu have a multi OS system i believe while... (3 Replies)
Discussion started by: frozensmilz
3 Replies

5. Shell Programming and Scripting

problem in exit status of the command in a shell script-FTP

Hi All, I have developed below script for FTP a file from unix machine to another machine. ftpToABC () { USER='xyz' PASSWD='abc' echo "open xx.yy.zbx.aaa user $USER $PASSWD binary echo "put $1 abc.txt" >> /home/tmp/ftp.$$ echo "quit" >> /home/tmp/ftp.$$ ftp -ivn <... (3 Replies)
Discussion started by: RSC1985
3 Replies

6. Shell Programming and Scripting

store last command exit status in variable in shell script

Hello All My req is to store the exit status of a command in shell variable I want to check whether the file has header or not The header will contain the string DATA_ACQ_CYC_CNTL_ID So I am running the command head -1 $i | grep DATA_ACQ_CYC_CNTL_ID Now I have to check if... (6 Replies)
Discussion started by: Pratik4891
6 Replies

7. Shell Programming and Scripting

Exit code from piping in unix shell script

Hi , I have following code in my shell script : "$TS_BIN/tranfrmr" "${TS_SETTINGS}/tranfrmr_p1.stx" "${TS_LOGS}/tranfrmr_p1.err" | ( "$TS_BIN/cusparse" "${TS_SETTINGS}/cusparse_p2.stx" "${TS_LOGS}/cusparse_p2.err" | ( "$TS_BIN/tsqsort" "${TS_SETTINGS}/srtforpm_p3.stx"... (8 Replies)
Discussion started by: sonu_pal
8 Replies

8. Shell Programming and Scripting

Executing 'exit' command from shell script

Hi, I am writing shell script to automate few use cases for CLI interface. We have CLI interface which has bunch of commands. I am trying to execute one of the commands 'exit' as part of automation to exit from CLI object (not from shell script) in my shell script. My intension is to execute... (4 Replies)
Discussion started by: Mahesh Desai
4 Replies

9. HP-UX

Find command doesn't return in shell script.

Hi All, I am using below snippet to search for a string (read from a file 'searchstring.out') in all locations (/) and then iterate over the files found to write the locations and the respective owner to an output file. However, this doesn't work as I believe the find command doesn't exit's... (11 Replies)
Discussion started by: Vipin Batra
11 Replies

10. UNIX for Beginners Questions & Answers

Linux shell | how to exit a script if any command fails.

Hi, i am new here let me say HI for all. now i have a question please: i am sending one command to my machine to create 3 names. if one of the names exists then the box return error message that already have the name but will continue to create the rests. How i can break the command and... (7 Replies)
Discussion started by: Amiri
7 Replies
IOHandler(3I)						    InterViews Reference Manual 					     IOHandler(3I)

NAME
IOHandler - read input, write output, or handle an I/O exception or timeout SYNOPSIS
#include <Dispatch/iohandler.h> DESCRIPTION
An iohandler reads data from a file descriptor, writes data to a file descriptor, handles an I/O exception on a file descriptor, or handles a timer's expiration. Once the user has requested the dispatcher to attach an iohandler to a file descriptor or a timer, the dispatcher will automatically notify the iohandler when the file descriptor's I/O condition changes or the timer expires. For convenience, the user can use a derived generic class (see IOCallback(3I)) to make the iohandler do nothing more than call an arbitrary object's member function. PUBLIC OPERATIONS
virtual int inputReady(int fd) virtual int outputReady(int fd) virtual int exceptionRaised(int fd) The dispatcher will call one of these functions to notify an iohandler that it can read data from a file descriptor, write data to a file descriptor, or handle an I/O exception on a file descriptor. The iohandler should perform the appropriate action and tell the dispatcher what to do next. A negative return value means that the iohandler encountered an error or it doesn't want to read or write anything more. The dispatcher will unlink the iohandler from its file descriptor automatically. A positive return value means that the iohandler didn't read or write everything that it could have. The dispatcher will call the iohandler again in round robin fashion WITHOUT checking select, which means that the iohandler will be called again as soon as the rest of the iohandlers have performed their actions. A zero return value means that the iohandler finished reading or writing everything it was able to. The dispatcher must check the descriptor's status with the select call before it can call the iohandler again. virtual void timerExpired(long sec, long usec) The dispatcher will call this function to notify an iohandler that a timer has expired. For informational purposes, the parameters give the current time in seconds and microseconds since midnight January 1, 1970. If the iohandler wants to reset the timer, it must tell the dispatcher to start another timer. SEE ALSO
Dispatcher(3I), IOCallback(3I) InterViews 9 January 1991 IOHandler(3I)
All times are GMT -4. The time now is 11:18 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy