[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: echo -n
From: |
Jyoti B Tenginakai |
Subject: |
Re: echo -n |
Date: |
Mon, 6 Feb 2017 09:45:26 +0530 |
Thanks you all,
Again I see that this printf we can use. But there are some scenarios where the o/p does not exactly match with echo. So still its good to have a way to pirnt -n /-e/-E with echo. Can this be considered as bug and can this be fixed?
Thanks & Regards
--Jyoti
****************************************
Jyoti Tenginakai
AIX-Security Development Team
IBM India Software Lab
EGD 'D' Block Sixth Floor
Off Indiranagar Koramangala Intermediate Ring Road
Bangaluru - 560071
ph: 41776666
extn: 76666
Mail:jyoti.b.t@in.ibm.com
Chet Ramey ---02/02/2017 11:21:16 PM---On 2/2/17 11:56 AM, Jyoti B Tenginakai wrote: > HI All,
From: Chet Ramey <chet.ramey@case.edu>
To: Jyoti B Tenginakai <jyoti.b.t@in.ibm.com>, Pierre Gaston <pierre.gaston@gmail.com>
Cc: chet.ramey@case.edu, Sangamesh Mallayya <sangamesh.swamy@in.ibm.com>, "bug-bash@gnu.org" <bug-bash@gnu.org>
Date: 02/02/2017 11:21 PM
Subject: Re: echo -n
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 chet@case.edu http://cnswww.cns.cwru.edu/~chet/
- echo -n, Sangamesh Mallayya, 2017/02/02
- Re: echo -n, Eduardo Bustamante, 2017/02/02
- Re: echo -n, Greg Wooledge, 2017/02/02
- Re: echo -n, Eric Blake, 2017/02/02
- Re: echo -n, John McKown, 2017/02/02
- Re: echo -n, Pierre Gaston, 2017/02/02
- Re: echo -n, Jyoti B Tenginakai, 2017/02/02
- Re: echo -n, Greg Wooledge, 2017/02/02
- Re: echo -n, John McKown, 2017/02/02
- Re: echo -n, Chet Ramey, 2017/02/02
- Re: echo -n,
Jyoti B Tenginakai <=
- Re: echo -n, Clark Wang, 2017/02/06
- Re: echo -n, Peter & Kelly Passchier, 2017/02/06
- Re: echo -n, Stephane Chazelas, 2017/02/06
- Re: echo -n, Stephane Chazelas, 2017/02/02