bash query

James Takac p3nndrag0n at gmail.com
Mon Jun 4 00:32:47 UTC 2007


Hi Tony

> > Hi Guys
> >
> > Thought I'd ask here re something I'm trying to do as it kinda relates to
> > the subject. Anyone know if you can pipe a command to a terminal session
> > in a script? I'm hoping for the script to open a terminal, pipe a command
> > to it, then when finished close the terminal window
>
> Most terminal window commands, e.g., xterm, rxvt, gnome-terminal, take
> an option that specifies a command to execute in the terminal window. If
> you want to do piping etc, then you probably have to invoke bash and
> give that the command(s) you want executed, e.g.,
>
> 	gnome-terminal -e 'bash -c "ls -lh"'
>
> or something similar!
>
> Regards,
> Tony.
> --
> Tony Arnold, IT Security Coordinator, University of Manchester,
> IT Services Division, Kilburn Building, Oxford Road, Manchester M13 9PL.
> T: +44 (0)161 275 6093, F: +44 (0)870 136 1004, M: +44 (0)773 330 0039
> E: tony.arnold at manchester.ac.uk, H: http://www.man.ac.uk/Tony.Arnold


Was pretty close but didn't work. Found the answer shortly after reading your 
reply and I put the following in my script to do the job

gnome-terminal --command="encfs /home/p3nn/Documents/agv/crypt /home/p3nn/Documents/agv/decrypt"

Thx
James




More information about the ubuntu-users mailing list