Re: Fwd: Re: interactive shell detection in shrc

Robert Elz <[email protected]>
Newsgroups gmane.os.netbsd.devel.userlevel
Message-ID <[email protected]>
    Date:        Wed, 25 Sep 2024 14:17:07 +0700
    From:        Robert Elz <[email protected]>
    Message-ID:  <[email protected]>

  | Not a syntax error, an execution error,

Sorry, saw your following message correcting that after I replied.

  | In NetBSD's sh you can actually do
  | 	''() { echo nothing; }

I perhaps could have added, and most probably shouldn't add, that
in NetBSD sh for the purposes desired here, one could do

	""() :

and then execute "" to get an exit status of 0, but that func
definition is likely to just look like line noise to even the
most aware of sh code reading experts.

It is irrelevant whether '' or "" is used, both make an empty word.

kre

kre
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.