LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 06-08-2013, 03:01 PM   #1
turbosur
LQ Newbie
 
Registered: May 2011
Posts: 7

Rep: Reputation: Disabled
Problem with stdin


Hi,

I've got a problem with adding customized entries to the stdin of a program. The program takes two entries separated by newline (in this case two read() commands from the stdin fd). This assignment is part of a wargame.. but I can't seem to figure it out.

I've been trying to pipe a multiline entry into the program, but it fails due to EOF. I've been trying redirection with the same result. I've also tried dup and dup2 without success..

My last hope was to copy/paste, but it seems like UTF-8 messes with the binary characters. Is there anyone who might be able to help me?

Regards,
Dan
 
Old 06-09-2013, 09:27 AM   #2
Sigg3.net
Member
 
Registered: Mar 2008
Location: Oslo, Norway
Distribution: Slackware 14.1 64-bit, Ubuntu 15.10, Fedora 17, Ubuntu 12 LTS and Ubuntu server 10.04
Posts: 173

Rep: Reputation: 28
If the read command encapsulates the variable in quotes "variable" or "$variable", you should be able to use any character AFAIK. Need more info
 
Old 06-09-2013, 10:58 PM   #3
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
I'm not entirely clear about your problem, can you post some code?
If you're trying to automate multi-line input, see the 'expect' tool.
HTH
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
unable to print using acroread on a node.....Acro read problem(lp: Error - stdin ) vsyed786 Linux - Enterprise 2 01-18-2012 04:28 AM
[SOLVED] stdin and pipes qwerty4061 Linux - Newbie 17 01-06-2012 02:54 AM
Problem with STDIN. dthai Linux - General 1 09-15-2006 02:22 AM
unbuffered stdin Mike Davies Linux - Software 1 03-03-2006 12:13 AM
unbuffered stdin mvt Programming 7 05-17-2004 09:40 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:46 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