GNU bug report logs - #13919
using echo to branch line

Previous Next

Package: coreutils;

Reported by: 王宾 <bwang2009 <at> yeah.net>

Date: Sun, 10 Mar 2013 18:27:01 UTC

Severity: normal

Tags: notabug

Done: Pádraig Brady <P <at> draigBrady.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 13919 in the body.
You can then email your comments to 13919 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-coreutils <at> gnu.org:
bug#13919; Package coreutils. (Sun, 10 Mar 2013 18:27:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to 王宾 <bwang2009 <at> yeah.net>:
New bug report received and forwarded. Copy sent to bug-coreutils <at> gnu.org. (Sun, 10 Mar 2013 18:27:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: 王宾 <bwang2009 <at> yeah.net>
To: bug-coreutils <at> gnu.org
Subject: using echo to branch line
Date: Sun, 10 Mar 2013 20:44:07 +0800 (CST)
[Message part 1 (text/plain, inline)]
--
hi,
As we know:
[polar <at> localhost my_shell]$ echo $PATH
/usr/local/Trolltech/Qt-4.7.4/bin:/usr/lib/qt-3.3/bin:/usr/kerberos/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/home/polar/bin:/sbin
[polar <at> localhost my_shell]$
when i use
[polar <at> localhost my_shell]$ echo  ${PATH//:/'\n'}   -e
to branch line and hope the result may be like this
[polar <at> localhost my_shell]$ echo $PATH | sed 's/:/\n/g'
/usr/local/Trolltech/Qt-4.7.4/bin
/usr/lib/qt-3.3/bin
/usr/kerberos/bin
/usr/local/bin
/usr/bin
/bin
/usr/X11R6/bin
/home/polar/bin
/sbin
[polar <at> localhost my_shell]$
but i can't get the result according---echo  ${PATH//:/'\n'}   -e, and i have searched the Internet but no answer, so i send this e-mail to you for help,  thank you for sparing your time and  thank you for your answer!

Best Wishes
------------------------------------------
Wang bin
Addr: XUPT.Xi'an.Shaanxi.China
E-mail: bwang2009 <at> yeah.net
Zip/Postal Code: 710061

[Message part 2 (text/html, inline)]

Information forwarded to bug-coreutils <at> gnu.org:
bug#13919; Package coreutils. (Mon, 11 Mar 2013 01:22:02 GMT) Full text and rfc822 format available.

Message #8 received at 13919 <at> debbugs.gnu.org (full text, mbox):

From: Pádraig Brady <P <at> draigBrady.com>
To: 王宾 <bwang2009 <at> yeah.net>
Cc: 13919 <at> debbugs.gnu.org
Subject: Re: bug#13919: using echo to branch line
Date: Mon, 11 Mar 2013 01:20:02 +0000
tag 13919 notabug
close 13919
stop

On 03/10/2013 12:44 PM, 王宾 wrote:
> --
> hi,
> As we know:
> [polar <at> localhost my_shell]$ echo $PATH
> /usr/local/Trolltech/Qt-4.7.4/bin:/usr/lib/qt-3.3/bin:/usr/kerberos/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/home/polar/bin:/sbin
> [polar <at> localhost my_shell]$
> when i use
> [polar <at> localhost my_shell]$ echo  ${PATH//:/'\n'}   -e
> to branch line and hope the result may be like this
> [polar <at> localhost my_shell]$ echo $PATH | sed 's/:/\n/g'
> /usr/local/Trolltech/Qt-4.7.4/bin
> /usr/lib/qt-3.3/bin
> /usr/kerberos/bin
> /usr/local/bin
> /usr/bin
> /bin
> /usr/X11R6/bin
> /home/polar/bin
> /sbin
> [polar <at> localhost my_shell]$
> but i can't get the result according---echo  ${PATH//:/'\n'}   -e, and i have searched the Internet but no answer, so i send this e-mail to you for help,  thank you for sparing your time and  thank you for your answer!

You need the -e first, for it to be interpreted as an option.
Be wary though, as echo has bad portability between various systems.

$ echo -e "${PATH//:/\n}"
/usr/bin
/bin

$ printf '%s\n' "$PATH" | tr ':' '\n'
/usr/bin
/bin

thanks,
Pádraig.




Added tag(s) notabug. Request was from Pádraig Brady <P <at> draigBrady.com> to control <at> debbugs.gnu.org. (Mon, 11 Mar 2013 01:22:03 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 13919 <at> debbugs.gnu.org and 王宾 <bwang2009 <at> yeah.net> Request was from Pádraig Brady <P <at> draigBrady.com> to control <at> debbugs.gnu.org. (Mon, 11 Mar 2013 01:22:03 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 08 Apr 2013 11:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 12 years and 126 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.