Re: Weird behaviour on echo

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 2005-07-18 at 00:56 +0200, Andy Pieters wrote:
> Hi all
> 
> Consider this
> 
> ~]$ echo "Test!"
> bash: !": event not found
> ~] $ echo "Test"!
> Test!
> ~] $ echo 'Test!'
> Test!
> ~] $ echo Test!
> Test!
> 
> I haven't heard anything about expansion of the '!' character, have you?

The ! is a special character in bash in some circumstances.  The "" can
give it the special meaning.

>From my documentation on bash,  !n references a previous command (the
nth command),  it also allows use of characters to list previously
issued (history) commands that start with that character(s)
an example of the first use
    [jeff@eye_gore ~]$ echo !12
    echo mkdir temp2
    mkdir temp2

and the second
   [jeff@eye_gore ~]$ echo !n
   echo ncftp 192.168.2.10
   ncftp 192.168.2.10

So in that context the "!" structure forces it to be interpreted with a
null argument and thus not a valid event to be referenced.
 
   [jeff@eye_gore ~]$ echo "!"
   bash: !: event not found
is in a slightly different category though

> With kind regards
> 
> 
> Andy
> 
> 
> -- 
> fedora-list mailing list
> fedora-list@xxxxxxxxxx
> To unsubscribe: http://www.redhat.com/mailman/listinfo/fedora-list


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux