grep '.'
cat -s # Remove single blank lines
create_stream | sed -e 's/^[ \t]*//' | consume_stream
create_stream | grep -o '^\S*' | consume_stream
echo '<root><foo a="b">lorem</foo><bar value="ipsum" /></root>' | \
python -c 'import sys;import xml.dom.minidom;s=sys.stdin.read();print xml.dom.minidom.parseString(s).toprettyxml()'
create_stream | awk 'NF' | consume_stream
find . -exec grep -i "hi rik" '{}' /dev/null \; -print
The -S
switch makes sudo read the password from STDIN. This means you can do:
echo mypassword | sudo -S command
# Try to read the configuration from:
# 1. the working directory
# 2. The user's home directory
# (in that order)
config_file=".slack.conf"
if [ -f "$(pwd)/$config_file" ]; then
source "$(pwd)/$config_file"
elif [ -f "$HOME/$config_file" ]; then
source "$HOME/$config_file"
fi
Configuration file (~/.slack.conf
) is of the following format:
# Your Slack hook URL
SLACK_HOOK_URL=https://hooks.slack.com/services/BEEF4UP4/BEEF2830/BEEFnA8zI4lbaMjR6zQ8FoWr