screen-users
[Top][All Lists]
Advanced

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

Re: Spawning commands inside interactive shells in new windows in a scri


From: László Monda
Subject: Re: Spawning commands inside interactive shells in new windows in a scriptable fashion
Date: Thu, 24 Jul 2008 01:12:04 +0200

Seems like I'm just ready with new-screen-window which I've just
attached.

From now on we can easily do things, like:
new-screen-window new-window-title 'du -h /'

Thanks for David for kicking ass with his way of doing this and for
Gokdeniz for explaining me the newline issue.

Possible improvements that are encouraged by me, since I suck at bash:

* Make specifying the window title optional by using a -t option.
* Jump back to the original window where new-screen-window ran.
* Provide a -j option for jumping to the new window.
* Interpret the rest of the command line as $command without quoting.

On Thu, 2008-07-24 at 00:44 +0300, Gokdeniz Karadag wrote:
> In a console based text editor( I use vim) you can press on following three 
> keys;
> ctrl v enter
> 
> This will embed a literal newline into the file, tested with the given 
> script. 
> I'm not sure about embedding newlines with GUI editors.
> 
> By the way, David's suggestion was very helpful, I realized I did not know 
> about -p
> 
> :)
> 
> 
> László Monda demis ki::
> > Hi David,
> > 
> > (David has allowed me to reply to his email publicly.)
> > 
> > I think this is almost exactly what I need, but "^M" gets literally
> > quoted for me, just like as "\^M" or "\015".
> > 
> > How can I put new line characters in there?
> > 
> > Thanks!
> > 
> > On Tue, 2008-07-22 at 09:10 +0100, address@hidden wrote:
> >> I don't know if this will help you but I have a small script that will
> >> start up folding at home in a running screen session. Here is the
> >> basis of it
> >>
> >> $ cat screen.scpt
> >> screen -S desktop4 -X screen -t t1
> >> screen -S desktop4 -p t1 -X stuff 'cd /^M'
> >> screen -S desktop4 -p t1 -X stuff 'ls ^M'
> >> screen -S desktop4 -X screen -t t2
> >> screen -S desktop4 -p t2 -X stuff 'cd programming^M'
> >> screen -S desktop4 -p t2 -X stuff 'file *^M'
> >>
> >> It will open a new screen called 't1', select it, cd to / and ls it,
> >> then another called 't2' move into my programming folder and do a
> >> 'file' on the content.
> >>
> >> It seems like this might be the basis for what you need?
> >>
> >> On 22/07/2008, László Monda <address@hidden> wrote:
> >>> On Thu, 2008-07-17 at 12:40 -0400, Mark Eichin wrote:
> >>>> looks like you might want to use "stuff" to push the commands at a
> >>>> normal screen that has a shell open (so that it runs them, and stays
> >>>> interactive.)
> >>> I don't think that "stuff" is capable of what I want to do.  I basically
> >>> want to write a script, like:
> >>>
> >>> new-screen-window ls
> >>> new-screen-window du /
> >>> new-screen-window my-script
> >>>
> >>> Where the new-screen-window utility opens new screen windows without
> >>> jumping to them.  I'd also like to specify the title of the individual
> >>> windows.
> >>>
> >>> --
> >>> Laci  <http://monda.hu>
> >>>
> >>>
> >>>
> >>> ------------------------------------------------------------------------
> >>>
> >>> _______________________________________________
> >>> screen-users mailing list
> >>> address@hidden
> >>> http://lists.gnu.org/mailman/listinfo/screen-users
> 
> 
> _______________________________________________
> screen-users mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/screen-users
-- 
Laci  <http://monda.hu>

Attachment: new-screen-window
Description: application/shellscript

Attachment: signature.asc
Description: This is a digitally signed message part


reply via email to

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