navi/tests/cheats/corner_cases.cheat
2020-03-14 18:08:57 -03:00

20 lines
No EOL
403 B
Text

% test
# reset terminal title
echo -ne "\033]0;$(hostname)\007"
# Find primary, local IP address
echo "8.8.8.8 via 172.17.0.1 dev eth0 src 172.17.0.2" | sed -E 's/.*src ([0-9.]+).*/\1/p' | head -n1
# simple echo
echo "foo"
# multiline command without backslash
echo "foo"
echo "bar"
# multiline command with backslash
echo "foo" \
| grep -q "bar" \
&& echo "match" \
|| echo "no match"