Hashing is the main piece of the solution in a Bash-coded puzzle. The hash (#) symbol put on the initial point of any line resembles an explanatory statement of any complicated program in Bash script. In this article, I will explain the term ‘Bash the hash’ with its practical execution. Let’s explore!
Key Takeaways
- Learning what is hashing in Bash script.
- Getting ideas about the execution of Bash hashing.
What is Bash Hashing?
Bash hashing is the symbolic formula for marking out single-line comments & multiple-line comments in Bash script. With some exceptions, putting a hash(#) symbol before any line is enough to call it a Bash comment. Apparently, it makes the compiler bound to skip the hashed line from the script execution. Thus, hashing turns a line into a non-executable code.
Execution of Bash Hashing
In the following section, you’ll get a visual concept of what happens to a hashed line during any script execution. So, move on to the steps below:
Steps to Follow >
➊ Open your Ubuntu Terminal.
➋ To open a script in the nano text editor, write the following command:
nano hash.sh
- nano: A text editor.
- hash.sh: This is a script that you can name by any of your choices. Here, I have named the script by ‘hash.sh’.