author | Oleksandr Gavenko <gavenkoa@gmail.com> |
Mon, 19 Oct 2015 17:04:52 +0300 | |
changeset 1769 | cadd23f8127f |
parent 774 | 74461231e9e7 |
permissions | -rw-r--r-- |
467 | 1 |
-*- mode: outline -*- |
2 |
||
3 |
* Download POSIX. |
|
4 |
||
5 |
http://www.opengroup.org/onlinepubs/009695399/download |
|
6 |
download page for SYSV3 |
|
7 |
||
8 |
http://www.opengroup.org/onlinepubs/9699919799/download |
|
9 |
download page for SYSV4 |
|
774
74461231e9e7
Shell command 'command'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
467
diff
changeset
|
10 |
|
74461231e9e7
Shell command 'command'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
467
diff
changeset
|
11 |
* Shell command. |
74461231e9e7
Shell command 'command'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
467
diff
changeset
|
12 |
|
74461231e9e7
Shell command 'command'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
467
diff
changeset
|
13 |
** command. |
74461231e9e7
Shell command 'command'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
467
diff
changeset
|
14 |
|
74461231e9e7
Shell command 'command'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
467
diff
changeset
|
15 |
Main semantic is to invoke command instead defined function with same name: |
74461231e9e7
Shell command 'command'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
467
diff
changeset
|
16 |
|
74461231e9e7
Shell command 'command'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
467
diff
changeset
|
17 |
$ ls() { ls --color "$@"; } |
74461231e9e7
Shell command 'command'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
467
diff
changeset
|
18 |
$ ls # infinitely loop as func invoke itself |
74461231e9e7
Shell command 'command'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
467
diff
changeset
|
19 |
$ ls() { command ls --color "$@"; } |
74461231e9e7
Shell command 'command'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
467
diff
changeset
|
20 |
$ ls . # invoke /bin/ls with color output |
74461231e9e7
Shell command 'command'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
467
diff
changeset
|
21 |
$ unset ls # forget func definition |
74461231e9e7
Shell command 'command'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
467
diff
changeset
|
22 |
$ ls # invoke /bin/ls without color output |
74461231e9e7
Shell command 'command'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
467
diff
changeset
|
23 |
|
74461231e9e7
Shell command 'command'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
467
diff
changeset
|
24 |
With '-p' arg Perform the command search using a default value for PATH that |
74461231e9e7
Shell command 'command'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
467
diff
changeset
|
25 |
is guaranteed to find all of the standard utilities: |
74461231e9e7
Shell command 'command'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
467
diff
changeset
|
26 |
|
74461231e9e7
Shell command 'command'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
467
diff
changeset
|
27 |
$ command -p getconf PATH |
74461231e9e7
Shell command 'command'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
467
diff
changeset
|
28 |
|
74461231e9e7
Shell command 'command'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
467
diff
changeset
|
29 |
|
74461231e9e7
Shell command 'command'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
467
diff
changeset
|
30 |
With '-v' arg work like 'which' command which not included in POSIX: |
74461231e9e7
Shell command 'command'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
467
diff
changeset
|
31 |
|
74461231e9e7
Shell command 'command'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
467
diff
changeset
|
32 |
$ command -v ls |
74461231e9e7
Shell command 'command'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
467
diff
changeset
|
33 |
/usr/bin/ls |
74461231e9e7
Shell command 'command'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
467
diff
changeset
|
34 |
$ command -v echo # for build-in command print command itself |
74461231e9e7
Shell command 'command'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
467
diff
changeset
|
35 |
echo # you can check for equality or for slash to |
74461231e9e7
Shell command 'command'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
467
diff
changeset
|
36 |
# distinguish from utilities |