help-bash
[Top][All Lists]
Advanced

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

Re: [Help-bash] When to use exec to replace the shell? (Bob Proulx)


From: David Niklas
Subject: Re: [Help-bash] When to use exec to replace the shell? (Bob Proulx)
Date: Sat, 30 Jan 2016 22:25:21 -0500

On Thu, 28 Jan 2016 14:02:32  Bob Proulx wrote:
> Another example.  I am logging in as a role user.  The shell for the
> role user is /bin/sh.  That is a common thing to do for role users.
> Or similarly I have used a rescue disk to boot up a non-booting system
> and it's rescue shell is /bin/sh.  In these cases /bin/sh is
> functional but not very command line typing friendly.  I want to use
> bash.  Therefore I type in 'exec bash' at the /bin/sh command line and
> the /bin/sh proces is now replaced by bash.  Now when I exit bash it
> will be just as if I had exited the original /bin/sh command line
> shell.  If I had not used exec then I would eventually need to exit
> twice.  One exit for the stacked bash and another exit for the
> original /bin/sh.  If I am never going to use it again then I might as
> well replace it completely.

You've made my life that much less annoying.
I've many times started a live cd or rescue system to encounter a strange
shell, ash, csh.
exec is what I need.

Thanks, David



reply via email to

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