Skip to content

Latest commit

 

History

History
116 lines (73 loc) · 1.5 KB

File metadata and controls

116 lines (73 loc) · 1.5 KB

How to Use This Guide

General Recommendations

Maximizing Your Learning Experience

The Companion Kit

http://from.faun.to/r/DGM7

Technical Recommendations and Standards Used in This Guide

Recommended Environment

Heredoc

cat <<EOF >file.txt
Passwords are like underwear:
- You shouldn’t leave them out where people can see them.
- You should change them regularly.
- You shouldn’t loan them out to strangers.
EOF
Passwords are like underwear:
- You shouldn’t leave them out where people can see them.
- You should change them regularly.
- You shouldn’t loan them out to strangers.
# export an environment variable
export ARGUMENT="world"

# create a file with the variable expanded
cat <<EOF >file.txt
Hello, $ARGUMENT!
EOF
Hello, world!
# create a file with the variable unexpanded
cat <<EOF >file.txt
Hello, \$ARGUMENT!
EOF
Hello, $ARGUMENT!

Long Commands

echo "This is a long command that \
spans multiple lines."
echo "This is a long command that spans multiple lines."
apt-get update && apt-get install \
  -y \
  vim \
  curl \
  wget
apt-get update && apt-get install -y vim curl wget

Environment Variables

# Sometimes you may need to change some values.
export MY_VARIABLE="[CHANGE_ME]"
# Then reuse it in your commands without any changes.
cat <<EOF >file.txt
$MY_VARIABLE
EOF