[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: echo -n
From: |
Jyoti B Tenginakai |
Subject: |
Re: echo -n |
Date: |
Thu, 2 Feb 2017 22:26:22 +0530 |
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
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
Pierre Gaston ---02/02/2017 08:45:56 PM---On Thu, Feb 2, 2017 at 11:02 AM, Sangamesh Mallayya < sangamesh.swamy@in.ibm.com> wrote:
From: Pierre Gaston <pierre.gaston@gmail.com>
To: Sangamesh Mallayya <sangamesh.swamy@in.ibm.com>
Cc: "bug-bash@gnu.org" <bug-bash@gnu.org>, Jyoti B Tenginakai <jyoti.b.t@in.ibm.com>
Date: 02/02/2017 08:45 PM
Subject: Re: echo -n
On Thu, Feb 2, 2017 at 11:02 AM, Sangamesh Mallayya <sangamesh.swamy@in.ibm.com> wrote:Hi,
description:
in bash echo -n , echo -e , echo -E has a special meaning. But we do not
have a way in bash shell if we want to print
-n , -e and -E using echo command. Other shells supports printing of
-n/-e/-E options using echo command.
For example
with ksh
# echo -n
-n
#
with bash
# echo -n
#
Please let us know if this a bug or do we have any other option to print
-n ?
Here is the environment details.
version: bash 4.3
Hardware and Operating System P7 AIX
Compiled with AIX xlc
Thanks,
-Sangamesh
Not a bug, echo is not portable and posix recommends using printf e.g.
printf '%s\n' -n
- 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 <=
- 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, 2017/02/05
- 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