LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-13-2009, 03:24 PM   #1
Yustu
LQ Newbie
 
Registered: Mar 2009
Posts: 2

Rep: Reputation: 0
bash stdin redirect


Hello.
I would like to know how can I redirect/use script to write into stdin.
I have a program that ask me question, answear is choice ("y/n") and i want pass that "n" into that program. How can i do that from bash?

Thanks for any sugestion
Best regards
 
Old 03-13-2009, 03:44 PM   #2
Hko
Senior Member
 
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: Debian
Posts: 2,536

Rep: Reputation: 111Reputation: 111
echo n | program
 
Old 03-13-2009, 03:45 PM   #3
Yustu
LQ Newbie
 
Registered: Mar 2009
Posts: 2

Original Poster
Rep: Reputation: 0
thank you very much.. i got order wrong ^^'
 
Old 03-13-2009, 08:01 PM   #4
Hko
Senior Member
 
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: Debian
Posts: 2,536

Rep: Reputation: 111Reputation: 111
Pipes ( | ) are one directional: from standard output ("stdout") to standard input ("stdin"). Left to right on the command line.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
BASH: Is it possible to take STDIN? microsoft/linux Programming 8 12-30-2011 05:21 PM
redirecting stdin in bash script artur Programming 3 12-09-2011 07:07 AM
How to redirect the stdin and stdout of child process which exec interactive prog? john.daker Programming 1 11-04-2008 09:27 AM
BASH -copy stdin to stdout (replace cat) (bash browser) gnashley Programming 4 07-21-2008 02:14 PM
redirect stdin/stdout of running process xtravar Linux - Software 3 03-06-2004 08:54 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:18 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration