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

Re: Dash man page not correct?



On 2022-09-23 at 13:20, Perry Smith wrote:

> I have Debian bullseye installed in a container.  My reading of the man page[1]
> is to use the -i flag to get dash to read $HOME/.profile.  But that doesn’t seem
> to work for me.  Instead, -l needs to be used.   At least, that seems to be true for
> me using Docker.  Does this seem to be correct?  If so, I will open a bug report
> but thought I would check here since Docker might be the root cause somehow.
> 
> Thank you,
> Perry
> [1] https://manpages.debian.org/bullseye/dash/dash.1.en.html

From that man page (or my local copy of it, anyway, which at a brief
comparison seems to be the same text as what's at that URL):

>> If no args are present and if the standard input of the shell is
>> connected to a terminal (or if the -i flag is set), and the -c
>> option is not present, the shell is considered an interactive
>> shell. An interactive shell generally prompts before each command
>> and handles programming and command errors differently (as
>> described below).

This states that '-i' makes it an interactive shell.

>> When first starting, the shell inspects argument 0, and if it
>> begins with a dash ‘-’, the shell is also considered a login shell.
>> This is normally done automatically by the system when the user
>> first logs in. A login shell first reads commands from the files
>> /etc/profile and .profile if they exist.

This states that if the shell is also a login shell, .profile is loaded.

From later in that same man page, we have:

>> -i interactive   Force the shell to behave interactively.
>> 
>> -l               Make dash act as if it had been invoked as a
>>                  login shell.

This indicates that '-i' produces an interactive shell, and '-l'
produces a login shell.

As far as I can tell, this documentation seems to match the behavior you
describe as what you see.

What is it about the man page which you are reading as suggesting that
'-i' will result in $HOME/.profile being read?

-- 
   The Wanderer

The reasonable man adapts himself to the world; the unreasonable one
persists in trying to adapt the world to himself. Therefore all
progress depends on the unreasonable man.         -- George Bernard Shaw

Attachment: signature.asc
Description: OpenPGP digital signature


Reply to: