Re: Passing string into stdin of screen

Michael Kelleher <[email protected]>
Newsgroups gmane.comp.gnu.screen.user
Message-ID <[email protected]>
To pass a command to a screen session to be intrepreted from stdin use the
following:

screen -X stuff "echo hello^M"

However make sure to generate the ^M by pressing Ctrl-V Enter.



On Wed, Dec 22, 2010 at 2:35 PM, wcjh <[email protected]> wrote:

>
> I'm using 'screen' as a terminal emulator to communicate to a serial
> device.
> However, I would like to script communication with this device.
> Does anyone know how I can either:
> 1. start a screen terminal with a command line argument that will be
> interpreted as stdin,
> or
> 2. Pass a string into stdin of a running screen session?
>
> My thought for option #2 was to use a combination of 'screen -X' and 'eval
> STR', where STR is the string I want to pass in. However, none of the
> following combinations were successful:
> screen -X "eval STR"
> screen -X "colon eval STR"
> screen -X "colon"; screen -X eval STR"
> screen -X "exec EXECUTABLE_SCRIPT_FILE"
>
> Does anyone have any suggestions on how to correctly accomplish the above
> task?
> Any suggestions about how I can pass strings directly into the serial
> device
> would also be welcomed.
>
> Thank you,
> William
>
> --
> View this message in context:
> http://old.nabble.com/Passing-string-into-stdin-of-screen-tp30516794p30516794.html
> Sent from the Gnu - Screen mailing list archive at Nabble.com.
>
>
> _______________________________________________
> screen-users mailing list
> screen-users-mXXj517/[email protected]
> http://lists.gnu.org/mailman/listinfo/screen-users
>

_______________________________________________
screen-users mailing list
screen-users-mXXj517/[email protected]
http://lists.gnu.org/mailman/listinfo/screen-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.