Sponsored Content
Top Forums Programming Detecting if command is waiting for input Post 302222570 by slash_blog on Thursday 7th of August 2008 03:41:28 AM
Old 08-07-2008
Quote:
Originally Posted by era
Redirect their standard input from /dev/null.

Code:
command </dev/null

Thanks! Yes this should work for the wait part. Smilie

But is there still a way to detect if the process is waiting on input?
Because if this is possible this will really help us in the long run.
 

9 More Discussions You Might Find Interesting

1. Programming

Detecting Keyboard Input without return

Hi, I need a way to detect the up and down arrow key inputs for my program. I do not want to wait for the return key to be entered(so that rules out getch() and family). Also I need to process several of these inputs in parallel, by servicing each request with a thread. Is that possible? ... (4 Replies)
Discussion started by: ravneetd
4 Replies

2. UNIX for Dummies Questions & Answers

problem with output of find command being input to basename command...

Hi, I am triying to make sure that there exists only one file with the pattern abc* in path /path/. This directory is having many huge files. If there is only one file then I have to take its complete name only to use furter in my script. I am planning to do like this: if ; then... (2 Replies)
Discussion started by: new_learner
2 Replies

3. Shell Programming and Scripting

SQL PLUS Command 'ACCEPT' is not waiting for user input with sh shell script

Dear All, The sqlplus 'Accept' command is not waiting for user input when I include the command within a shell script. Note: The 'Accept' command is working fine if I execute it in a SQLPLUS Prompt. Please fins the below sample script which i tried. SCRIPT: -------- #!... (4 Replies)
Discussion started by: little_wonder
4 Replies

4. UNIX for Dummies Questions & Answers

Send email with attachment and body : mailx , waiting for input , signal Control D

Hi, I am trying to send email with attacment and body using "mailx" (cat body.txt; uuencode attach.txt) | mailx -s "Attachment" abc@xyz.com When i type this command, the shell is still waiting for me to enter something in standard input and press control D before it sends a mail and... (2 Replies)
Discussion started by: aliaszero
2 Replies

5. Shell Programming and Scripting

How to skip command if it is hanging while waiting for response

Hello, I have a script that contains the command "whois 1.2.3.4" Sometimes this command takes far too long to produce any output and as a result the rest of the script is not executed. Can anyone suggest a method so that if no output is produced after say 2 seconds the script skips that... (2 Replies)
Discussion started by: colinireland
2 Replies

6. Shell Programming and Scripting

read command not waiting

Dear All, read command not waiting for my input, please suggest. code: while read line do echo "$line " | grep -i .par$ if ; then cd ../par echo " Do you want to proceed" read else cd ../sql read fi done <inp.txt Its not asking me any input? (2 Replies)
Discussion started by: mahendra singh
2 Replies

7. UNIX for Dummies Questions & Answers

passing input into a cmd line that's waiting for a response

Hi, I am writing a little script to update a parameters on JMQ. however the JMQ requires a "y" confirmation to be input as part of the cmd I am running. However I want run this script to offline with no input from a user. it works if a I create a file with with just y in it and pass that in... (3 Replies)
Discussion started by: shropshirehobbi
3 Replies

8. Shell Programming and Scripting

How to detect that foreground process is waiting for input?

Hi, I have to create a script (ksh or perl) that starts certain number of parallel jobs (another scripts), each of them runs as a foreground process in a separate session. Plus I start monitoring job that has to determine if any of those scripts is expecting input from operator, and switch to... (4 Replies)
Discussion started by: andyh80
4 Replies

9. Shell Programming and Scripting

Shell read command is not waiting for user input

Hi, i am working on one automation , for that i have writing one shell program that take user input in "while read line" block. but read command is taking value that is readed by While block. while read line; do command 1; command 2 echo -n "Do you want to continute > " read rsp... (2 Replies)
Discussion started by: ranvijaidba
2 Replies
RCMD(1) 						    BSD General Commands Manual 						   RCMD(1)

NAME
rcmd -- backend driver for rcmd(3) SYNOPSIS
rcmd [-46dn] [-l username] [-p port] [-u localusername] host command DESCRIPTION
rcmd executes command on host. rcmd copies its standard input to the remote command, the standard output of the remote command to its standard output, and the standard error of the remote command to its standard error. Interrupt, quit and terminate signals are propagated to the remote command; rcmd normally terminates when the remote command does. The options are as follows: -4 Use IPv4 addresses only. -6 Use IPv6 addresses only. -d The -d option turns on socket debugging (using setsockopt(2)) on the TCP sockets used for communication with the remote host. -l By default, the remote username is the same as the local username. The -l option allows the remote name to be specified. Another pos- sible way to specify the remote username is the notation user@host. -n The -n option redirects input from the special device /dev/null (see the BUGS section of this manual page). -p port Uses the given port instead of the one assigned to the service ``shell''. May be given either as symbolic name or as number. -u The -u option allows the local username to be specified. Only the superuser is allowed to use this option. Shell metacharacters which are not quoted are interpreted on local machine, while quoted metacharacters are interpreted on the remote machine. For example, the command rcmd otherhost cat remotefile >> localfile appends the remote file remotefile to the local file localfile, while rcmd otherhost cat remotefile ">>" other_remotefile appends remotefile to other_remotefile. FILES
/etc/hosts SEE ALSO
rsh(1), rcmd(3), environ(7) HISTORY
The rcmd command appeared in NetBSD 1.3 and is primarily derived from rsh(1). Its purpose was to create a backend driver for rcmd(3) that would allow the users of rcmd(3) to no longer require super-user privileges. BUGS
If you are using csh(1) and put a rcmd in the background without redirecting its input away from the terminal, it will block even if no reads are posted by the remote command. If no input is desired you should redirect the input of rcmd to /dev/null using the -n option. You cannot use rcmd to run an interactive command (like rogue(6) or vi(1)). Use rlogin(1) instead. The stop signal, SIGSTOP, will stop the local rcmd process only. This is arguably wrong, but currently hard to fix for reasons too compli- cated to explain here. BSD
May 31, 2011 BSD
All times are GMT -4. The time now is 11:45 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy