LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Problem with stdin (https://www.linuxquestions.org/questions/linux-general-1/problem-with-stdin-4175465264/)

turbosur 06-08-2013 03:01 PM

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

Sigg3.net 06-09-2013 09:27 AM

If the read command encapsulates the variable in quotes "variable" or "$variable", you should be able to use any character AFAIK. Need more info:)

chrism01 06-09-2013 10:58 PM

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


All times are GMT -5. The time now is 06:31 AM.