The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




Thread: redirect STDIN
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #4 (permalink)  
Old 01-03-2007
iamcollins iamcollins is offline
Registered User
  
 

Join Date: Dec 2006
Posts: 8
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.