Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[bash] Für was ist der Befehl "command"?

1 view
Skip to first unread message

Marco Moock

unread,
Oct 11, 2022, 2:59:18 AM10/11/22
to
Hallo zusammen,

was genau macht dieser Befehl?
Gibt keine Manpage, kein info, kein whatis.

--
Gruß
Marco

Alexander Goetzenstein

unread,
Oct 11, 2022, 3:10:18 AM10/11/22
to
Hallo,

Am 11.10.22 um 08:59 schrieb Marco Moock:
> Hallo zusammen,
>
> was genau macht dieser Befehl?
> Gibt keine Manpage, kein info, kein whatis.

immerhin gibt es einen Hilfetext -hilft der Dir vielleicht weiter?

> ~> command --help
> command: command [-pVv] Kommando [Argument ...]
> Execute a simple command or display information about commands.
>
> Runs COMMAND with ARGS suppressing shell function lookup, or display
> information about the specified COMMANDs. Can be used to invoke commands
> on disk when a function with the same name exists.
>
> Options:
> -p use a default value for PATH that is guaranteed to find all of
> the standard utilities
> -v print a description of COMMAND similar to the `type' builtin
> -V print a more verbose description of each COMMAND
>
> Exit Status:
> Returns exit status of COMMAND, or failure if COMMAND is not found.



--
Gruß
Alex

Rolf Buenning

unread,
Oct 11, 2022, 3:10:50 AM10/11/22
to
Marco Moock <mo...@posteo.de> schrieb:
> Hallo zusammen,
>
> was genau macht dieser Befehl?
> Gibt keine Manpage, kein info, kein whatis.
>
Aber ein Help, commnd --help

Rolf

Christian Weisgerber

unread,
Oct 11, 2022, 6:30:06 AM10/11/22
to
On 2022-10-11, Marco Moock <mo...@posteo.de> wrote:

> was genau macht dieser Befehl?
> Gibt keine Manpage, kein info, kein whatis.

bash$ type command
command is a shell builtin

type is übrigens in jeder POSIX-Shell verfügbar.

$ type type
type is a shell builtin

Also: command ist in der bash eingebaut und entsprechend in der
bash-Manpage beschrieben. Außerdem hat bash für eingebaute Befehle
auch eine eingebaute Kurzanleitung:

bash$ help command
command: command [-pVv] command [arg ...]
Execute a simple command or display information about commands.
...

--
Christian "naddy" Weisgerber na...@mips.inka.de

Bernd Mayer

unread,
Oct 11, 2022, 9:18:36 AM10/11/22
to
Am 11.10.22 um 08:59 schrieb Marco Moock:
> Hallo zusammen,
>
> was genau macht dieser Befehl?
> Gibt keine Manpage, kein info, kein whatis.

Hallo,

hier auf OpenSUSE gibt es eine manpage dazu.

Und hier gibt es eine online-Version:
https://www.man7.org/linux/man-pages/man1/command.1p.html


Bernd Mayer

Helmut Waitzmann

unread,
Oct 11, 2022, 3:49:55 PM10/11/22
to
Marco Moock <mo...@posteo.de>:

[Es geht um den Befehl «command»:]


> was genau macht dieser Befehl?
>
> Gibt keine Manpage, kein info, kein whatis.
>

«command» ist, wie Christian schreibt, in den Shell eingebaut. 
Deshalb ist die Handbuchseite des Shells zuständig.

Weil er aber Teil des POSIX‐Standards für Shells ist, empfiehlt
sich auch ein Blick in
<https://pubs.opengroup.org/onlinepubs/9699919799/utilities/command.html#top>. 
Und tatsächlich:  Erst dort erfährt man die ganze Wahrheit über
«command».

(Ich zitiere noch einmal:)


> was genau macht dieser Befehl?
>

Ich gehe zunächst mal davon aus, dass du genug Englisch
verstehst, um im POSIX‐Standard lesen zu können.  Deshalb
schreibe ich jetzt nicht ab, was dort (siehe oben den angeführten
URL) steht.  Kurz:  Das Shell‐Kommando

command -- a_simple_command …

versucht nicht, eine Shell‐Funktion mit Namen «a_simple_command»
zu starten, sollte so eine Funktion definiert sein.  Darüber
hinaus nimmt «command» den special built‐in utilities
(<https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_14>),
die man damit aufruft, manche ihrer speziellen Eigenschaften.

Arno Welzel

unread,
Oct 13, 2022, 1:30:51 PM10/13/22
to
Marco Moock, 2022-10-11 08:59:

> Hallo zusammen,
>
> was genau macht dieser Befehl?
> Gibt keine Manpage, kein info, kein whatis.

command --help

--
Arno Welzel
https://arnowelzel.de

0 new messages