bug-bash
[Top][All Lists]
Advanced

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

Re: echo -n


From: Chet Ramey
Subject: Re: echo -n
Date: Thu, 2 Feb 2017 12:49:48 -0500
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:45.0) Gecko/20100101 Thunderbird/45.7.0

On 2/2/17 11:56 AM, Jyoti B Tenginakai wrote:
> HI All,
> 
> Thanks for your quick response.
> 
> I have tried using the printf instead of echo. But the issue with printf is
> , the behaviour is not consistent with what echo prints for all the inputs
> i.e.
> In my script I am generically using echo for all the options. If I have to
> use printf instead of it should behave consistently .
> if echo * is passed to bash shell, the o/p shows the \t seperated values
> whereas with printf '%s' *, it won't display space separated output. Again
> printf '%s ' # behaviour is different from what echo # shows

echo()
{
        builtin printf "%s\n" "$*"
}

You can make this more elaborate if you want.

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    address@hidden    http://cnswww.cns.cwru.edu/~chet/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]