screen-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using the stuff command in screen


From: Dave Woodfall
Subject: Re: Using the stuff command in screen
Date: Sun, 12 Apr 2020 14:50:07 +0100

On 2020-04-11 11:28,
dan d. <address@hidden> put forth the proposition:
>
> I recently recieved help here with the eval command to attach a stack of 
> commands to a key binding.
> In one version i use the exec command on a key binding to call a shell script 
> containing the screen commands, it works perfectly.
> This made it easy to experiment by just changing the script file.
> --
> I thought the stuff command which seemed to me to allow making macros for any 
> program with key bindings and shell scripts also.
> That screen command can send keyboord commands to a program instead of shell 
> commands.
> I have run into a problem.  I set up a shell script using the stuff command 
> to experiment.
>  I use lynx a text only web browser; I wanted a stuff macro which starts with 
> entering an "o" to enter the options selection section of it.
> The idea was to allow a series of lynx commands to change an option on the 
> fly, the "o" was the first of them.
>
> The "o" appeared on the lynx program screen as though entered as typed text; 
> it did not initiate entry into the options section as it does manually
> I tried it in a text editor, the "o" appeared as though entered manually.

It would help to see your `stack' of commands really.

If you're using running numerous commands that include `exec's,
beware, because I've found that screen (4.6.2 anyway) doesn't wait
for exec to finish, and will run the next command in the list
immediately.  I haven't found a way around this non-blockingness, and
even using `sleep' doesn't seem to have any effect.

Your best bet is probably to put all the commands you need into a
single shell script and run that instead.  You can specify arguments
to it if necessary, and then use $1 $2 etc. in the script.

--
Dave

The antibloat squad!
For those interested in no bloat, minimal desktop Linux
gopher://tty1.uk/1/?minimal-linux
http://tty1.uk/minimal-linux
#minimallinux @ chat.freenode.net



reply via email to

[Prev in Thread] Current Thread [Next in Thread]