How to Use This Guide
Technical Recommendations and Standards Used in This Guide
Recommended Environment
I recommend using a Linux-based environment. macOS users can use the Terminal application, which is a Unix-based shell. Windows users can use the Windows Subsystem for Linux (WSL) or Git Bash, which provides a Unix-like environment.
Heredoc
In this guide, we will extensively make use of heredoc to create files. Heredoc is a way to create multi-line strings in Bash. It is a redirection method that allows you to pass multiple lines of input to a command. Here is an example:
cat <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
The <> operator redirects the output to a file. As a result, when you copy and paste the whole block to your terminal, it will create a file named file.txt with the content:
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.
When >> is used instead of >, the content will be appended to the file instead of overwriting it.
When a variable is used inside a heredoc, it will be expanded. For example:
# export an environment variable
export ARGUMENT="world"
# create a file with the variable expanded
cat <file.txt
Hello, $ARGUMENT!
EOF
DevSecOps in Practice
A Hands-On Guide to Operationalizing DevSecOps at ScaleEnroll now to unlock current content and receive all future updates for free. Your purchase supports the author and fuels the creation of more exciting content. Act fast, as the price will rise as the course nears completion!
