Open ale5000-git opened 1 year ago
If possible it will also be nice to support:
-n
Do not print a trailing newline character.
on cut
.
This is one that I really need.
-n
Do not print a trailing newline character.
Where are you seeing that? On my system cut
in coreutils has:
-n with -b: don't split multibyte characters
-n Do not print a trailing newline character.
TBH I don't think this is particularly useful. Most commands do add \n
, so dealing with that systematically and correctly is something you should be doing anyway - everywhere, so I don't think such non-portable flag is very useful.
Also, this doesn't solve the case where the value ends in newline[s]. So the difference between dealing with that with or without a single additional newline adds exactly one char to the code.
After reading more carefully it is just my misunderstanding, I just mixed in my head these two:
POSIX will be standardizing realpath in Issue 8:
https://www.austingroupbugs.net/view.php?id=1457
As such, the standard requirements that all utilities not explicitly excluded (basically, echo is one of the few explicit exceptions) MUST accept -- as end-of-options, even when the standard does not require any standardized options.
and
POSIX will be standardizing readlink (just the -n option) ...
Change things for readlink so that the POSIX-mandated -n and -- work
even when disabling the non-standard (and partially non-working) -f
when FEATURE_READLINK_FOLLOW is clear
@avih: It is very useful to optimize performance, to remove the newline I have to either pipe the result of cut to tr or use command substitution. If I have to execute them a lot of times it will be a lot slower than just a parameter.
These in particular have issues:
drop -- whoami
realpath -- .
Quote from a message at https://bugs.busybox.net/show_bug.cgi?id=15466:
I'm sure most cases will be fixed upstream but it would be nice also if you support it also in utilities that are specific of BusyBox for Windows.