Re: su 5.2.1 does not invoke bash as a login shell when stdin is from a pipe
- From: Dave Gibson <dave+news001@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 12 Sep 2006 20:31:05 +0100
Angel Tsankov <fn42551@xxxxxxxxxxxxxxxx> wrote:
Here's a scenario in which su from coreutils 5.2.1 does not
invoke bash as a login shell:
[ piping commands to su ]
As a workaround, pass '-l' through to the shell:
# echo 'echo $PATH' | su - -- USER -l
Dave, this is the first workaround that comes around! How does it
work?
Arguments after the user name are passed directly to the shell, the -l
just tells the shell to behave like a login shell.
The '--' is needed to prevent the GNU getopt_long library function
re-organising the command line (the default behaviour would be for
"su - USER -l" to be transformed to "su -l - USER").
.
- Follow-Ups:
- Re: su 5.2.1 does not invoke bash as a login shell when stdin is from a pipe
- From: Angel Tsankov
- Re: su 5.2.1 does not invoke bash as a login shell when stdin is from a pipe
- References:
- Re: su 5.2.1 does not invoke bash as a login shell when stdin is from a pipe
- From: Angel Tsankov
- Re: su 5.2.1 does not invoke bash as a login shell when stdin is from a pipe
- Prev by Date: Re: *pressure Google to put Groups back on main page...*
- Next by Date: Re: su 5.2.1 does not invoke bash as a login shell when stdin is from a pipe
- Previous by thread: Re: su 5.2.1 does not invoke bash as a login shell when stdin is from a pipe
- Next by thread: Re: su 5.2.1 does not invoke bash as a login shell when stdin is from a pipe
- Index(es):
Relevant Pages
|