![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to write to stdin of another program (program A -> [stdin]program B) | vvaidyan | UNIX for Dummies Questions & Answers | 3 | 08-02-2008 05:21 PM |
| How to write to stdin of another program (program A -> [stdin]program B) | vvaidyan | High Level Programming | 1 | 04-30-2008 01:44 PM |
| Redirecting to stdin | flame_eagle | Shell Programming and Scripting | 4 | 02-20-2008 04:25 PM |
| stdin | marquis | High Level Programming | 2 | 04-14-2005 01:49 PM |
| stdin not tty when try to pine or redirect | Micz | UNIX for Dummies Questions & Answers | 1 | 05-20-2004 02:58 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
redirect STDIN
can you redirect STDIN with command arguments?
I have tried this approach: Code:
# ./script -option <argument1> <argument2> 0<$2 # $2: ambiguous redirect Last edited by prkfriryce; 01-03-2007 at 05:37 PM.. |
|
||||
|
Quote:
in bash, it still tries to read arg2 as a text file: Code:
# script -option arg1 < arg2 # arg2: No such file or directory |
|
||||
|
Hi
I am not clear with your exact requirement. If i am not mistaken, by default your input is going to be from STDIN. One point to say here. Inside a shell script if there is any redirection of the standard input to a file, then subshells, functions and everything else also inherit the changed file descriptor. After that statement, your read will not get input from STDIN. In that case, you could use a read as mentioned below: read newinput < /dev/tty If think this is what you are asking for. If not, please provide the script you faced the problem, which would help to analyze and provide better solution saving time. |
|
||||
|
I am trying to automate the script without changing the script, or without waiting for the script to run, then inputing the STDIN from keyboard, tty, etc.
|
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|