From: Kevin Korb <kmk@sanitarium.net>
To: Bastian Bittorf <bittorf@bluebottle.com>
Cc: dash@vger.kernel.org
Subject: Re: [bug?] echo -n does not work as described
Date: Thu, 12 Nov 2015 11:11:35 -0500 [thread overview]
Message-ID: <5644BA37.2090606@sanitarium.net> (raw)
In-Reply-To: <20151112081006.GV19618@medion.lan>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Then why is the -n behaviour documented in the man page?
On 11/12/2015 03:10 AM, Bastian Bittorf wrote:
> * Kevin Korb <kmk@sanitarium.net> [12.11.2015 08:52]:
>> $ echo -n testing - -n testing
>
> in POSIX the '-n' switch (and -e) is undefined. you can work around
> this via hijacking the call:
>
> #!/bin/sh echo() { case "$1" in '-n') shift printf '%s' "$@" ;; *)
> printf '%s\n' "$@" ;; esac }
>
> echo foo echo -n bar
>
> if you really want to remove all the bashisms, it can be a lot of
> work. dont blame dash for this, but the script author. also
> consider using shellsheck.net for this with the correct shebang.
>
> bye, bastian -- To unsubscribe from this list: send the line
> "unsubscribe dash" in the body of a message to
> majordomo@vger.kernel.org More majordomo info at
> http://vger.kernel.org/majordomo-info.html
>
- --
~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,
Kevin Korb Phone: (407) 252-6853
Systems Administrator Internet:
FutureQuest, Inc. Kevin@FutureQuest.net (work)
Orlando, Florida kmk@sanitarium.net (personal)
Web page: http://www.sanitarium.net/
PGP public key available on web site.
~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
iEYEARECAAYFAlZEujcACgkQVKC1jlbQAQfIuQCeJrtFu94ThY+48k5zphx+s1i/
mJAAn2zHqfppmvh7mCrWuXHJGnkq9XJ6
=pqKh
-----END PGP SIGNATURE-----
next prev parent reply other threads:[~2015-11-12 16:11 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-12 1:56 [bug?] echo -n does not work as described Kevin Korb
2015-11-12 3:14 ` Eric Blake
2015-11-12 3:40 ` Kevin Korb
2015-11-12 3:46 ` Kevin Korb
2015-11-12 8:35 ` Seb
2015-11-12 16:12 ` Kevin Korb
2015-11-12 21:24 ` Stephane Chazelas
2015-11-12 8:10 ` Bastian Bittorf
2015-11-12 16:11 ` Kevin Korb [this message]
2015-11-19 12:36 ` Bastian Bittorf
2015-11-12 10:03 ` Petr Šabata
2015-11-12 16:18 ` Kevin Korb
2015-11-12 16:55 ` Kevin Korb
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5644BA37.2090606@sanitarium.net \
--to=kmk@sanitarium.net \
--cc=bittorf@bluebottle.com \
--cc=dash@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.