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

Re: how to run xterm with nested bash shells, or screen nested inside bash



Dear Zenaan,

Zenaan Harkness wrote:
> >From an existing plain xterm, I want this command:
> uxterm -e /bin/bash -c /usr/bin/screen
> 
> or eg:
> uxterm -e /bin/bash -c /bin/sh
> 
> To result in a nested shell. Basically I want my xterms to open by
> default with a screen session (which works fine), but I want to be
> able to log out of screen with CTRL-D, and be left with plain bash in
> my uxterm.
> 
> Is this possible?

I’m not quite sure I understood what you want to achieve, but here we
go: I tried with xfce4-terminal, but that should mostly behave the
same as uxterm. Essentially, there are two problems to solve here:

a) xfce4-terminal -e /bin/bash -c /usr/bin/mc

is read as the "-c" option by the terminal, not the shell. We need 

$ xfce4-terminal -e "/bin/bash -c /usr/bin/mc"

to pass -c to bash rather than xfce4-terminal.

b) Furthermore, bash appears to have no option not to exit after the
command passed via -c exits. However:

$ xfce4-terminal -e "/bin/bash -c \"/usr/bin/mc && /bin/sh\""

runs /bin/sh after /usr/bin/mc exits sucessfully (use ; instead of &&
to ignore return codes).

HTH & Best,

Claudius
-- 
Please don’t CC me.


Reply to: