mirror of
https://github.com/chubin/cheat.sheets
synced 2024-11-19 03:25:44 +00:00
Merge branch 'master' of https://github.com/chubin/cheat.sheets
This commit is contained in:
commit
fbe957f77d
@ -38,8 +38,10 @@ echo ${PIPESTATUS[0]} # replace 0 with N
|
||||
for i in $(seq 1 4); do echo $i; done
|
||||
|
||||
# Test if a program exists in the path
|
||||
command -v <program> 2>&1 >/dev/null || error "<program> not installed"
|
||||
# There are false positives: aliases and functions
|
||||
command -v ${program} >/dev/null 2>&1 || error "${program} not installed"
|
||||
|
||||
# Redirection
|
||||
my_command 2>&1 > command-stdout-stderr.txt
|
||||
my_command 2>&1 > /dev/null
|
||||
# Please note that 2>&1 goes after
|
||||
my_command > command-stdout-stderr.txt 2>&1
|
||||
my_command > /dev/null 2>&1
|
||||
|
Loading…
Reference in New Issue
Block a user