Re: [bug?] echo -n does not work as described

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

 



-----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@xxxxxxxxxxxxxx> [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@xxxxxxxxxxxxxxx More majordomo info at
> http://vger.kernel.org/majordomo-info.html
> 

- -- 
~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,
	Kevin Korb			Phone:    (407) 252-6853
	Systems Administrator		Internet:
	FutureQuest, Inc.		Kevin@xxxxxxxxxxxxxxx  (work)
	Orlando, Florida		kmk@xxxxxxxxxxxxxx (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-----
--
To unsubscribe from this list: send the line "unsubscribe dash" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux