Shellprogrammierung (Linux): Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
| Zeile 4: | Zeile 4: | ||
Hilfe zu externen Kommandos: <code>man <command></code> | Hilfe zu externen Kommandos: <code>man <command></code> | ||
== Status bei Pipes == | |||
=== Links === | |||
[https://stackoverflow.com/questions/1221833/pipe-output-and-capture-exit-status-in-bash https://stackoverflow.com/questions/1221833/pipe-output-and-capture-exit-status-in-bash] | |||
== Testscripte == | == Testscripte == | ||
Version vom 3. Februar 2018, 11:44 Uhr
Allgemein
Hilfe zu eingebauten Kommandos: help <command>
Hilfe zu externen Kommandos: man <command>
Status bei Pipes
Links
https://stackoverflow.com/questions/1221833/pipe-output-and-capture-exit-status-in-bash
Testscripte
getops
#!/bin/bash
while getopts "l:m" OPTION &>/dev/null
do
case "$OPTION" in
l) echo "Option l with argument $OPTARG";;
m) echo "Option m without argument";;
*) echo "Wrong option $OPTION";;
esac
done
# OPTING contains the next argument
shift `expr ${OPTIND} - 1`
echo "command = `basename $0`, first argument = $1"
Fortschrittsanzeige
Links
http://wiki.bash-hackers.org/commands/classictest
http://linuxint.com/DOCS/Linux_Docs/openbook_shell/index.htm
Zurück zu Ubuntu