Sponsored Content
Top Forums Shell Programming and Scripting read from std i/p with timeout within a script Post 302310995 by Blue_shadow on Monday 27th of April 2009 02:38:52 PM
Old 04-27-2009
not a good start for me
I found the answer some place else in the forum.
I should search more before asking
the answer is to use read -t
thanx all
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

ksh read timeout

any idea on how to timeout the read statement for ksh? for bash u can use read -t option -t timeout Cause read to time out and return failure if a complete line of input is not read within timeout seconds. This option has ... (2 Replies)
Discussion started by: ashterix
2 Replies

2. Shell Programming and Scripting

How to redirect std out and std err to same file

Hi I want both standard output and standard error of my command cmd to go to the same file log.txt. please let me know the best commandline to do this. Thanks (2 Replies)
Discussion started by: 0ktalmagik
2 Replies

3. Programming

Sun Studio C++ - Getting error in linking std::ostream &std::ostream::operator<<(std:

Hello all Im using CC: Sun C++ 5.6 2004/07/15 and using the -library=stlport4 when linkning im getting The fallowing error : Undefined first referenced symbol in file std::ostream &std::ostream::operator<<(std::ios_base&(*)(std::ios_base&))... (0 Replies)
Discussion started by: umen
0 Replies

4. Shell Programming and Scripting

How to read multiple lines from Std Input into an array

Hi All, Does anyone know how to read multiple lines from standard input into an array and then iterate a loop for all the lines read. Below is an example pseudocode: I need the below filenames to be read by the script into an array or something similar: And then in the script, I... (9 Replies)
Discussion started by: bharath.gct
9 Replies

5. Shell Programming and Scripting

Ksh script: std Out/err

Hello gurus, this is part of my script: ls -1 ${MyFile} >> ${dir_log}ListFile${Now}.tmp FILENUM=`cat ${dir_log}ListFile${Now}.tmp| wc -l | awk '{print $1}'`>> /dev/null if then writeError "ERRORE: no file in directory for type ${FileName}!" >> ${LogFileName} Close 1 fi... (7 Replies)
Discussion started by: GERMANICO
7 Replies

6. Shell Programming and Scripting

password file as std input to script

I'm a fairly new AIX admin (disclaimer). We have SQL scripts written by end users that use a userid and passwd to connect to our DB2 database. Is it possible to create an "input file" that contains the db2 connect parameters and yet secure the file from the SQL creator? i.e., they can "use"... (2 Replies)
Discussion started by: mpheine
2 Replies

7. Boot Loaders

read sectors from disk failed with timeout

i'm writing some code to simulate the boot progress after power on but when i try to read the 2nd sector from a floppy disk, this operation always fail with ah=0x80h which means timeout, how can i get over this problem? my code would be like this: $ cat boot.S .code16 #define SETUPLEN 4... (0 Replies)
Discussion started by: wljackhero
0 Replies

8. Linux

read sectors from disk failed with timeout

i'm writing some code to simulate the boot progress after power on but when i try to read the 2nd sector from a floppy disk, this operation always fail with ah=0x80h which means timeout, how can i get over this problem? my code would be like this: $ cat boot.S .code16 #define SETUPLEN 4... (0 Replies)
Discussion started by: wljackhero
0 Replies

9. UNIX for Advanced & Expert Users

read sectors from disk failed with timeout

i'm writing some code to simulate the boot progress after power on but when i try to read the 2nd sector from a floppy disk, this operation always fail with ah=0x80h which means timeout, how can i get over this problem? my code would be like this: $ cat boot.S .code16 #define SETUPLEN 4... (0 Replies)
Discussion started by: wljackhero
0 Replies

10. Shell Programming and Scripting

Read timeout

I saw several thread for this issue but none addresses my issue. I have tried read -t but the result is read bad options My requirement is 1. Ask for input 2. If input = y or no input in 60 seconds then continue processing else exit fi Kindly consider this urgent. (8 Replies)
Discussion started by: rprasad
8 Replies
RRDp(3) 						User Contributed Perl Documentation						   RRDp(3)

NAME
RRDp - Attach RRDtool from within a perl script via a set of pipes; SYNOPSIS
use RRDp RRDp::start path to RRDtool executable RRDp::cmd rrdtool commandline $answer = RRD::read $status = RRD::end $RRDp::user, $RRDp::sys, $RRDp::real, $RRDp::error_mode, $RRDp::error DESCRIPTION
With this module you can safely communicate with the RRDtool. After every RRDp::cmd you have to issue an RRDp::read command to get RRDtools answer to your command. The answer is returned as a pointer, in order to speed things up. If the last command did not return any data, RRDp::read will return an undefined variable. If you import the PERFORMANCE variables into your namespace, you can access RRDtool's internal performance measurements. use RRDp Load the RRDp::pipe module. RRDp::start path to RRDtool executable start RRDtool. The argument must be the path to the RRDtool executable RRDp::cmd rrdtool commandline pass commands on to RRDtool. Check the RRDtool documentation for more info on the RRDtool commands. Note: Due to design limitations, RRDp::cmd does not support the "graph -" command - use "graphv -" instead. $answer = RRDp::read read RRDtool's response to your command. Note that the $answer variable will only contain a pointer to the returned data. The reason for this is, that RRDtool can potentially return quite excessive amounts of data and we don't want to copy this around in memory. So when you want to access the contents of $answer you have to use $$answer which dereferences the variable. $status = RRDp::end terminates RRDtool and returns RRDtool's status ... $RRDp::user, $RRDp::sys, $RRDp::real these variables will contain totals of the user time, system time and real time as seen by RRDtool. User time is the time RRDtool is running, System time is the time spend in system calls and real time is the total time RRDtool has been running. The difference between user + system and real is the time spent waiting for things like the hard disk and new input from the Perl script. $RRDp::error_mode and $RRDp::error If you set the variable $RRDp::error_mode to the value 'catch' before you run RRDp::read a potential ERROR message will not cause the program to abort but will be returned in this variable. If no error occurs the variable will be empty. $RRDp::error_mode = 'catch'; RRDp::cmd qw(info file.rrd); print $RRDp::error if $RRDp::error; EXAMPLE
use RRDp; RRDp::start "/usr/local/bin/rrdtool"; RRDp::cmd qw(create demo.rrd --step 100 DS:in:GAUGE:100:U:U RRA:AVERAGE:0.5:1:10); $answer = RRDp::read; print $$answer; ($usertime,$systemtime,$realtime) = ($RRDp::user,$RRDp::sys,$RRDp::real); SEE ALSO
For more information on how to use RRDtool, check the manpages. AUTHOR
Tobias Oetiker <tobi@oetiker.ch> perl v5.12.1 2010-03-22 RRDp(3)
All times are GMT -4. The time now is 06:02 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy