help-bash
[Top][All Lists]
Advanced

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

Re: [Help-bash] about --norc


From: Peng Yu
Subject: Re: [Help-bash] about --norc
Date: Mon, 10 Dec 2018 13:52:44 -0600

On Mon, Dec 10, 2018 at 1:27 PM Chet Ramey <address@hidden> wrote:
>
> On 12/10/18 2:24 PM, Peng Yu wrote:
> >>> --norc Do not read and execute the personal initialization file
> >>> ~/.bashrc if the shell is **interactive**.  This option is on by default
> >>> if the shell is invoked as sh.
> >
> > What I was not clear is what "invoked as sh" means. It sounds like it
> > is the same as "not interactive" as it is written in the above
> > sentence. But I am not sure non-interactive is necessary like sh.
>
> You're overthinking it, and you removed the formatting. Invoked as
> \fBsh\fP (formatting as in the man page) means being invoked with
> the name "sh".

OK. This makes sense now. Probably "the name" should be added before
"sh". Despite "sh" is highlighted, I was not sure what the highlight
meant.

BTW, here is the test case.

$ cat main.sh
#!/usr/bin/env bash
# vim: set noexpandtab tabstop=2:

set -v
tmpdir=$(mktemp -d)
cd "$tmpdir"
ln -s "$(which bash)" sh
export PATH=$tmpdir:$PATH
which sh
sh
$ ./main.sh
tmpdir=$(mktemp -d)
cd "$tmpdir"
ln -s "$(which bash)" sh
export PATH=$tmpdir:$PATH
which sh
/var/folders/r7/bvmh1vvx41d63snvgbdz7bl40000gr/T/tmp.LNB9vj4Xv8/sh
sh
sh-4.4$


-- 
Regards,
Peng



reply via email to

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