[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: bash "while do echo" can't function correctly
From: |
Greg Wooledge |
Subject: |
Re: bash "while do echo" can't function correctly |
Date: |
Wed, 13 Apr 2016 08:29:00 -0400 |
User-agent: |
Mutt/1.4.2.3i |
On Wed, Apr 13, 2016 at 06:49:51AM -0500, John McKown wrote:
> ???Ah. Thanks. I only use BASH and the GNU infrastructure, so I have never
> run into that problem. I think I'll change my habits, just in case I run
> across a system which doesn't have it (especially in my scripts)
Every implementation of echo has *some* input on which it fails,
including bash's implementation.
imadev:~$ type echo
echo is a shell builtin
imadev:~$ x=-n
imadev:~$ echo "$x"
imadev:~$ printf '%s\n' "$x"
-n
You simply hadn't run into any of the failure cases yet.