Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Dash man page not correct?

0 views
Skip to first unread message

Perry Smith

unread,
Sep 23, 2022, 1:50:05 PM9/23/22
to
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

The Wanderer

unread,
Sep 23, 2022, 2:00:06 PM9/23/22
to
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

signature.asc

Perry Smith

unread,
Sep 25, 2022, 11:10:05 AM9/25/22
to
signature.asc

The Wanderer

unread,
Sep 25, 2022, 11:20:06 AM9/25/22
to
On 2022-09-25 at 11:00, 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.

I replied to your message on the same day it was sent. If you have not
seen it, I suspect you may well not be subscribed to the mailing list.

If you want to be CCed on replies to messages you send to the mailing
list, please state that in the message itself.

Alternately, please consider subscribing, so that you will receive
replies regardless.

In the meantime, you can read replies already sent via the list
archives, which are available at:

https://lists.debian.org/debian-user/

My specific reply can be seen at:

https://lists.debian.org/debian-user/2022/09/msg00611.html
signature.asc

Perry Smith

unread,
Sep 25, 2022, 11:30:07 AM9/25/22
to


On Sep 25, 2022, at 10:10, The Wanderer <wand...@fastmail.fm> wrote:

On 2022-09-25 at 11:00, 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.

I replied to your message on the same day it was sent. If you have not
seen it, I suspect you may well not be subscribed to the mailing list.

If you want to be CCed on replies to messages you send to the mailing
list, please state that in the message itself.

Alternately, please consider subscribing, so that you will receive
replies regardless.

In the meantime, you can read replies already sent via the list
archives, which are available at:

https://lists.debian.org/debian-user/

My specific reply can be seen at:

https://lists.debian.org/debian-user/2022/09/msg00611.html

Thank you.  I was not subscribed.  I went to https://lists.debian.org/debian-user/ 
and searched but didn’t notice that it was only page 1 of 2.

I misunderstood / misread this phrase:

    … the shell is also considered a login shell …

In particular the ‘also’.  The only suggestion I can give is something like:

    When first starting, the shell inspects argument 0, and if it begins with a dash ‘-’, 
    the shell is considered a login shell which is also interactive.

The first time “login” is mentioned is after the “also” implying that inclusion in
something else.

A separate paragraph might make it clearer as well since the topic has shifted
from an interactive shell to a login shell.

Perry

signature.asc

Charles Curley

unread,
Sep 25, 2022, 4:10:06 PM9/25/22
to
On Sun, 25 Sep 2022 11:10:39 -0400
The Wanderer <wand...@fastmail.fm> wrote:

> Alternately, please consider subscribing, so that you will receive
> replies regardless.

Please do. Some of us crusty old curmudgeons don't always remember to
CC people who aren't on the list.

--
Does anybody read signatures any more?

https://charlescurley.com
https://charlescurley.com/blog/
0 new messages