Received: from mail.l3u.de (mail.l3u.de [IPv6:2a01:4f8:1c1c:d482::1]) by gbr-app-1.alpinelinux.org (Postfix) with ESMTPS id 147402235BC for <~alpine/users@lists.alpinelinux.org>; Sat, 25 May 2024 09:49:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=stonemx.de; s=default; t=1716630571; bh=uBUDbZSBSCdBKjRBeM3WhnhAWGzSJKJlb5bbfOqZcec=; h=From:To:Subject:Date:From; b=yuUx4FXCZaSd6jJWb1dPlODB32XD5iw8kwTDJFOalJDx3145SPqIFQ3DD27IwFybJ Cw6k3VCKARNhczXWgwnUnRSJbR691JVD+LS3vGpgoeg394Z/lPmdUp3co3ye6kPhGC 82PylrfUwcAo8RHwxYH1wtjbKX8gUyAIu9Kjh6f5oYF19GRjuGFL2TFW6UYvpyA+G3 rcFTS9RZ+KRzFkiUTpf5ZAhR2B2vdg/+bfyBcRjVHuN5tH5R7u4ThUplnt6lP+vcoP S0hL3snp5hdOg7/6FE1Q7zdmaDyO4qFUutqmyUtoB9puQJGqsJLfA+8xC4QrwhS6xa RsTSsUH3vwc4w== Received: from ginuog.localnet (p200300e7a7023f00a8e730fffe3150ed.dip0.t-ipconnect.de [IPv6:2003:e7:a702:3f00:a8e7:30ff:fe31:50ed]) by mail.l3u.de (Postfix) with ESMTPSA id 43F76FF083 for <~alpine/users@lists.alpinelinux.org>; Sat, 25 May 2024 11:49:31 +0200 (CEST) From: Tobias Leupold To: ~alpine/users@lists.alpinelinux.org Subject: ash and su/su - Date: Sat, 25 May 2024 11:49:31 +0200 Message-ID: <1926392.IobQ9Gjlxr@ginuog> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Hi all :-) I'm new to Alpine Linux. I replaced Devuan with Alpine for my Raspberry Pi yesterday, and now I stumbled upon one thing that may be due to the Busybox ash shell: I wanted to keep the nice minimalism Alpine brings and keep using ash (on all my other machines, I have, like most of us, bash). I learned I could add ~/.profile to add a nice PS1, aliases and such stuff there. I did that for both my normal user and root. However, I noticed that when I run su to become root, this file is not sourced and I get the default prompt I had before, without my aliases. When I do su -, I see the shell as if I e.g. connected directly to root via ssh, but e.g. the current directory is changed to /root. This is different from what I know from my other machines. On my Gentoo, Artix, Devuan and Ubuntu machines, I (apparently) see no difference to the shell, no matter if I login directly to root, or do an su. So what's the background? What is the difference of "su" and "su -"? And can I make ~/.profile being sourced when I do a simple "su"? Thanks for all clarification and help! Cheers, Tobias