You are not logged in.
Pages: 1
Hi,
I'm wondering if it is possible to have some bash (or sh/zsh) command to open a new terminal and execute some other commands using it's stdin.
Example:
I want to open new konsole (or xterm or rxvt) window using a command like:
run_cmd="ls -al && read" konsole -e sh -c "$run_cmd"
However it doesn't work. It would be nice if it could take input from standard input or from run_cmd variable.
Any bash scripting hero here ?
/Matt
Offline
Try run_cmd="ls -al && bash"
So just start a shell after the && as command.
Website: andrwe.org
Offline
That's ok, and I know how to do it.
Still .. I want to open a new terminal with this command, as I want to be able to popup a new terminal window in ion.
Offline
try this:
xterm -e ls\;bash &
Offline
I'm not entirely sure what you are trying to do... but
run_cmd="ls -al && read" urxvt -e sh -c "$run_cmd"
works at least.
Last edited by Zeist (2010-02-15 17:46:56)
I haven't lost my mind; I have a tape back-up somewhere.
Twitter
Offline
I checked it and the first solution doesn't wait, it closes the terminal after ls, and the second keeps it open, but there is no output of ls, so I'm not sure if it gets called.
Combination of those two would be awesome
@Zeist, this comment was for you
@n0dix, wow .. thanks .. it works
now I have to find a way to place the windows where I want, but that's a different story
Again, the day was saved by Arch Community (TM)
Thank you
Last edited by mateusz.f (2010-02-15 17:51:49)
Offline
Pages: 1