From: Harald Hoyer <harald-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: WANG Chao <chaowang-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Cc: initramfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH] emergency_shell: Use '\W' in $PS1 variable to show current working directory.
Date: Tue, 12 Mar 2013 09:44:53 +0100 [thread overview]
Message-ID: <513EEB05.9050706@redhat.com> (raw)
In-Reply-To: <1363064503-14783-1-git-send-email-chaowang-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Am 12.03.2013 06:01, schrieb WANG Chao:
> Signed-off-by: WANG Chao <chaowang-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
> ---
> modules.d/98systemd/dracut-emergency.sh | 2 +-
> modules.d/99base/dracut-lib.sh | 4 ++--
> 2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/modules.d/98systemd/dracut-emergency.sh b/modules.d/98systemd/dracut-emergency.sh
> index a0a4b12..af8daf2 100755
> --- a/modules.d/98systemd/dracut-emergency.sh
> +++ b/modules.d/98systemd/dracut-emergency.sh
> @@ -29,7 +29,7 @@ if getargbool 1 rd.shell -d -y rdshell || getarg rd.break -d rdbreak; then
> echo
> echo
> [ -f /etc/profile ] && . /etc/profile
> - [ -z "$PS1" ] && export PS1="$_name:\${PWD}# "
> + [ -z "$PS1" ] && export PS1="$_name:\W# "
> exec sh -i -l
> else
> warn "$action has failed. To debug this issue add \"rd.shell rd.debug\" to the kernel command line."
> diff --git a/modules.d/99base/dracut-lib.sh b/modules.d/99base/dracut-lib.sh
> index d2c803a..e96411e 100755
> --- a/modules.d/99base/dracut-lib.sh
> +++ b/modules.d/99base/dracut-lib.sh
> @@ -906,7 +906,7 @@ _emergency_shell()
> local _name="$1"
> if [ -n "$DRACUT_SYSTEMD" ]; then
> > /.console_lock
> - echo "PS1=\"$_name:\${PWD}# \"" >/etc/profile
> + echo "PS1=\"$_name:\W# \"" >/etc/profile
> systemctl start dracut-emergency.service
> rm -f /etc/profile
> rm -f /.console_lock
> @@ -924,7 +924,7 @@ _emergency_shell()
> echo
> echo 'Dropping to debug shell.'
> echo
> - export PS1="$_name:\${PWD}# "
> + export PS1="$_name:\W# "
> [ -e /.profile ] || >/.profile
>
> _ctty="$(RD_DEBUG= getarg rd.ctty=)" && _ctty="/dev/${_ctty##*/}"
>
\W does not work with dash.
Maybe you want:
export PS1="[$_name:\${PWD##*/}]# "
next prev parent reply other threads:[~2013-03-12 8:44 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-12 5:01 [PATCH] emergency_shell: Use '\W' in $PS1 variable to show current working directory WANG Chao
[not found] ` <1363064503-14783-1-git-send-email-chaowang-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2013-03-12 8:44 ` Harald Hoyer [this message]
[not found] ` <513EEB05.9050706-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2013-03-12 10:01 ` WANG Chao
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=513EEB05.9050706@redhat.com \
--to=harald-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
--cc=chaowang-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=initramfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox