The following issue has been SUBMITTED. ====================================================================== https://austingroupbugs.net/view.php?id=1628 ====================================================================== Reported By: mirabilos Assigned To: ====================================================================== Project: Online Pubs Issue ID: 1628 Category: Shell and Utilities Type: Enhancement Request Severity: Editorial Priority: normal Status: New Name: mirabilos Organization: MirBSD User Reference: URL: https://pubs.opengroup.org/onlinepubs/9699919799/utilities/xargs.html Section: xargs(1) ====================================================================== Date Submitted: 2023-01-15 17:18 UTC Last Modified: 2023-01-15 17:18 UTC ====================================================================== Summary: Add -o (reopen stdin) option to xargs(1) Description: Now that 243 is accepted, I would like to request the addition of another option to xargs(1) to make it really useful. It’s a BSD thing:
-o Reopen stdin as /dev/tty in the child process before executing the command. This is useful if you want xargs to run an interac- tive application. I’ve been using this a *lot*, as something like… $ git find \*.h -print0 | xargs -0o $EDITOR … (where https://github.com/mirabilos/git-find/ is the tool in question), or with just a simple find, or a (git) grep -Z. I also have been able to successfully convince GNU coreutils to add precisely this (they also added a GNU --long-option but added it with -o for BSD compatibility). (I know I should use -0or but I lazily skip the -r if I know there’s at least one anyway.) Desired Action: In SYNOPSIS, change -0ptrx to -0optrx. In DESCRIPTION, where it says the results are unspecified if the utility reads from stdin, add unless the -o flag is given. In OPTIONS, add: .It Fl o Reopen stdin as .Pa /dev/tty in the child process before executing the command. This is useful if you want .Nm to run an interactive application. In INPUT FILES, mention that -o also uses /dev/tty. Possibly add a suitable example; do we have grep -Z yet in POSIX (it’s not in 243)? Otherwise, 'find . -name \*.h -print0 | xargs -0or $EDITOR' will probably do. ====================================================================== Issue History Date Modified Username Field Change ====================================================================== 2023-01-15 17:18 mirabilos New Issue 2023-01-15 17:18 mirabilos Name => mirabilos 2023-01-15 17:18 mirabilos Organization => MirBSD 2023-01-15 17:18 mirabilos URL => https://pubs.opengroup.org/onlinepubs/9699919799/utilities/xargs.html 2023-01-15 17:18 mirabilos Section => xargs(1) ======================================================================