lundi 16 février 2015

printf>stdin unusable with read


With read, sending "a" to stdin is not equivalent to pressing "a" (or use your favorite letter/key).


Tested this:



~$ read -n1 & fg
[1] 11620
read


Then "typed" "a" into the read process stdin (in another console):



~$ printf "a" >/proc/11620/fd/0


How do I make the stdin method equivalent to direct typing? Should I add some special control character, like:



~$ printf "a\x04" >/proc/11620/fd/0 # didn't work either


Aucun commentaire:

Enregistrer un commentaire