[Sussex] A little bash help...

Paul Turner pturner at rentokil.com
Wed Feb 2 15:44:24 UTC 2005


Geoffrey Teale wrote:

>On Wed, 2005-02-02 at 15:32 +0000, Paul Graydon wrote:
>  
>
>>LOL.... 
>>
>>Damn I'm slow.  Missed all of them on my first read through :-)
>>    
>>
>
>It takes a few seconds to realise that you can't give echo any options
>at all, and then the penny drops..
>  
>

Yes you can.

echo "hi\nhi"

gives:
hi\nhi

and

echo -e "hi\nhi"

gives:
hi
hi


Have I missed the plot?


P.


NAME
       echo - display a line of text

SYNOPSIS
       echo [OPTION]... [STRING]...

DESCRIPTION
       NOTE:  your shell may have its own version of echo which will 
supercede
       the version described here. Please refer to your shell's  
documentation
       for details about the options it supports.

       Echo the STRING(s) to standard output.

       -n     do not output the trailing newline

       -e     enable interpretation of the backslash-escaped characters 
listed
              below

       -E     disable interpretation of those sequences in STRINGs

       --help display this help and exit

       --version
              output version information and exit

       Without -E, the following sequences are recognized and interpolated:

       \NNN   the character whose ASCII code is NNN (octal)

       \\     backslash

       \a     alert (BEL)

       \b     backspace

       \c     suppress trailing newline

       \f     form feed

       \n     new line

       \r     carriage return

       \t     horizontal tab

       \v     vertical tab


-- 

*/Paul Turner/*
Applications Team Leader
*Rentokil Initial* Corporate IT


------------------------------------------------------------------------
Information in this message is confidential and may be privileged. It is 
intended solely for the person(s) to whom it is addressed. If you are 
not the intended recipient, please notify the sender, and please delete 
the message from your system immediately.
------------------------------------------------------------------------


 

_____________________________________________________________________
This message has been checked for all known viruses by 
MessageLabs on behalf of Rentokil Initial plc





More information about the Sussex mailing list