GNU bug report logs - #19243
echo comand bug

Previous Next

Package: coreutils;

Reported by: "Chema F. Ledesma" <hecam33 <at> gmail.com>

Date: Mon, 1 Dec 2014 18:02:03 UTC

Severity: normal

Tags: notabug

Done: Eric Blake <eblake <at> redhat.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 19243 in the body.
You can then email your comments to 19243 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#19243; Package coreutils. (Mon, 01 Dec 2014 18:02:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Chema F. Ledesma" <hecam33 <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-coreutils <at> gnu.org. (Mon, 01 Dec 2014 18:02:03 GMT) Full text and rfc822 format available.

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

From: "Chema F. Ledesma" <hecam33 <at> gmail.com>
To: bug-coreutils <at> gnu.org
Subject: echo comand bug
Date: Mon, 1 Dec 2014 18:56:05 +0100
[Message part 1 (text/plain, inline)]
Hello,

I just wanted to report a bug i think i hava found on the echo comand.

If you execute echo "!!!!!!!!!!!!!!!!!!!!!!!!" it does something strange
repeating the last command before echo comand.

I am using Ubuntu 14.04

-- 
Chema F. Ledesma
[Message part 2 (text/html, inline)]

Added tag(s) notabug. Request was from Eric Blake <eblake <at> redhat.com> to control <at> debbugs.gnu.org. (Mon, 01 Dec 2014 18:13:02 GMT) Full text and rfc822 format available.

Reply sent to Eric Blake <eblake <at> redhat.com>:
You have taken responsibility. (Mon, 01 Dec 2014 18:13:02 GMT) Full text and rfc822 format available.

Notification sent to "Chema F. Ledesma" <hecam33 <at> gmail.com>:
bug acknowledged by developer. (Mon, 01 Dec 2014 18:13:02 GMT) Full text and rfc822 format available.

Message #12 received at 19243-done <at> debbugs.gnu.org (full text, mbox):

From: Eric Blake <eblake <at> redhat.com>
To: "Chema F. Ledesma" <hecam33 <at> gmail.com>, 19243-done <at> debbugs.gnu.org
Subject: Re: bug#19243: echo comand bug
Date: Mon, 01 Dec 2014 11:12:51 -0700
[Message part 1 (text/plain, inline)]
tag 19243 notabug
thanks

On 12/01/2014 10:56 AM, Chema F. Ledesma wrote:
> Hello,
> 
> I just wanted to report a bug i think i hava found on the echo comand.
> 
> If you execute echo "!!!!!!!!!!!!!!!!!!!!!!!!" it does something strange
> repeating the last command before echo comand.

Thanks for the report.  However, this is not a bug in 'echo', but a
feature of your shell.  At least bash has a notion of history expansion,
where double-quoted ! is a shortcut for injecting previously-typed
commands from your history into the current command invocation.  Read
'man bash' and search for "history" for details.

History expansion occurs BEFORE 'echo' sees its command line arguments.
 You'd get the same effect with ANY OTHER COMMAND, when given the same
argument.  Thus, this is not a bug in coreutils, and I'm closing this
report, although you should feel free to comment with any further questions.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

[signature.asc (application/pgp-signature, attachment)]

Information forwarded to bug-coreutils <at> gnu.org:
bug#19243; Package coreutils. (Tue, 02 Dec 2014 09:29:02 GMT) Full text and rfc822 format available.

Message #15 received at 19243-done <at> debbugs.gnu.org (full text, mbox):

From: Erik Auerswald <auerswal <at> unix-ag.uni-kl.de>
To: 19243-done <at> debbugs.gnu.org, "Chema F. Ledesma" <hecam33 <at> gmail.com>
Subject: Re: bug#19243: echo comand bug
Date: Tue, 2 Dec 2014 10:28:27 +0100
Hi,

On Mon, Dec 01, 2014 at 11:12:51AM -0700, Eric Blake wrote:
> On 12/01/2014 10:56 AM, Chema F. Ledesma wrote:
> > 
> > If you execute echo "!!!!!!!!!!!!!!!!!!!!!!!!" it does something strange
> > repeating the last command before echo comand.
> 
> Thanks for the report.  However, this is not a bug in 'echo', but a
> feature of your shell.

And because of this you can use single quotes instead of double quotes to
print those exclamation marks:

$ echo '!!!!!!!!!!!!!!!!!!!!!!!!'
!!!!!!!!!!!!!!!!!!!!!!!!

Thanks,
Erik
-- 
Be water, my friend.
                        -- Bruce Lee




Information forwarded to bug-coreutils <at> gnu.org:
bug#19243; Package coreutils. (Tue, 02 Dec 2014 13:23:01 GMT) Full text and rfc822 format available.

Message #18 received at 19243-done <at> debbugs.gnu.org (full text, mbox):

From: Eric Blake <eblake <at> redhat.com>
To: Erik Auerswald <auerswal <at> unix-ag.uni-kl.de>, 19243-done <at> debbugs.gnu.org,
 "Chema F. Ledesma" <hecam33 <at> gmail.com>
Subject: Re: bug#19243: echo comand bug
Date: Tue, 02 Dec 2014 06:22:13 -0700
[Message part 1 (text/plain, inline)]
On 12/02/2014 02:28 AM, Erik Auerswald wrote:
> Hi,
> 
> On Mon, Dec 01, 2014 at 11:12:51AM -0700, Eric Blake wrote:
>> On 12/01/2014 10:56 AM, Chema F. Ledesma wrote:
>>>
>>> If you execute echo "!!!!!!!!!!!!!!!!!!!!!!!!" it does something strange
>>> repeating the last command before echo comand.
>>
>> Thanks for the report.  However, this is not a bug in 'echo', but a
>> feature of your shell.
> 
> And because of this you can use single quotes instead of double quotes to
> print those exclamation marks:
> 
> $ echo '!!!!!!!!!!!!!!!!!!!!!!!!'
> !!!!!!!!!!!!!!!!!!!!!!!!

Or turn off history expansion:

$ set +o history
$ echo "!!!!"
!!!!

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

[signature.asc (application/pgp-signature, attachment)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 31 Dec 2014 12:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 10 years and 229 days ago.

Previous Next


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