Bug 1205366 - Consider adding /usr/bin/command binary
Summary: Consider adding /usr/bin/command binary
Status: NEW
Alias: None
Product: openSUSE Tumbleweed
Classification: openSUSE
Component: Basesystem (show other bugs)
Version: Current
Hardware: All openSUSE Tumbleweed
: P5 - None : Enhancement (vote)
Target Milestone: ---
Assignee: Lubos Kocman
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-11-12 13:38 UTC by Giorgio Gallo
Modified: 2022-11-23 03:55 UTC (History)
2 users (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Giorgio Gallo 2022-11-12 13:38:09 UTC
User-Agent:       Mozilla/5.0 (X11; Linux x86_64; rv:106.0) Gecko/20100101 Firefox/106.0
Build Identifier: 

One of the sh scripts I used to run on fedora gave "xargs: command: No such file or directory" on opensuse (the offending line was something similar to "echo $variable | xargs command ssh-add -q").

It turns out opensuse (I think all versions?) lacks "command" as a standalone executable.

According to some rando on reddit [1], command is required by POSIX... even if turns out that is not the case, it's a tiny executable and other distros have it: would it hurt to add it?


[1] https://www.reddit.com/r/linuxquestions/comments/yt32r9/comment/iw23fw8

Reproducible: Always

Steps to Reproduce:
1. $ echo | xargs command -v ls
Actual Results:  
xargs: command: No such file or directory

Expected Results:  
/usr/bin/ls
Comment 1 Andreas Stieger 2022-11-12 14:52:59 UTC
`command` is a shell built-in, as per the POSIX requirements. xargs does not work with shell built-ins. The wrapper shipped on some distributions simply a script calling the same. Yes it would hurt to add it: is not free to maintain, and encourages incorrect usage.