Adding additional usefuls

additional redirection tricks
convert spaces to underscores
named pipes for colorizing tail of multiple files
pull/31/head
Scott R. Godin 6 years ago committed by GitHub
parent 4ca9d684c5
commit 04e39026e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -45,3 +45,13 @@ command -v ${program} >/dev/null 2>&1 || error "${program} not installed"
# Please note that 2>&1 goes after
my_command > command-stdout-stderr.txt 2>&1
my_command > /dev/null 2>&1
# Redirect stdout and stderr of cmd1 to cmd2
cmd1 |& cmd2
# Convert spaces to underscores in filenames
for name in *\ *; do mv -vn "$name" "${name// /_}"; done
# ccze usage with named pipe for coloring tail of multiple logfiles at once:
mkfifo pipe
tail -s .5 -n 120 -f httpd_access_log httpd_error_log httpd_modsec_audit_log >pipe &
ccze < pipe

Loading…
Cancel
Save