-
Notifications
You must be signed in to change notification settings - Fork 218
Open
Description
本件もご執筆時の環境 Ubuntu 20.04 では正常動作することはこちらでも確認しておりますが、一応、報告させていただきます。
$ yes --version
yes (GNU coreutils) 9.4
...
$ yes paste -d . '<(shuf -n1 -e {1..254})'{,,,} | head -n 100 | bash
yes: invalid option -- 'd'
Try 'yes --help' for more information.release 8.31 から yes 等の動作に変更があった模様です。 (Ubuntu 20.04 では yes (GNU coreutils) 8.30 。)
$ zless /usr/share/doc/coreutils/NEWS.gz
* Noteworthy changes in release 8.31 (2019-03-10) [stable]
...
** Changes in behavior
cksum, dd, hostid, hostname, link, logname, sleep, tsort, unlink,
uptime, users, whoami, yes: now always process --help and --version options,
regardless of any other arguments present before any optional '--'
end-of-options marker.
nohup now processes --help and --version as first options even if other
parameters follow.
'yes a -- b' now outputs 'a b' instead of including the end-of-options
marker as before: 'a -- b'.
というわけで、 Ubuntu 24.04 等でも正常実行させるには
$ yes 'paste -d .' '<(shuf -n1 -e {1..254})'{,,,} | head -n 100 | bashまたは
$ yes -- paste -d . '<(shuf -n1 -e {1..254})'{,,,} | head -n 100 | bashまたは
$ yes () { if [[ "$1" = -* ]]; then command yes "$@"; else command yes -- "$@"; fi; }; export -f yes
$ yes paste -d . '<(shuf -n1 -e {1..254})'{,,,} | head -n 100 | bashなどとする必要がありました。
以上、あくまでもご参考としての報告でした。
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels