echo "Hello, BASH!"
‘Cause having your computer do something you do daily on your behalf is fantastic.
Bash is a Unix Shell, allowing a user to interact with an operating system by entering commands.
Shell Scripting is to write Bash Scripts to run in the Bash Shell. Unfortunately, I need to look up the syntax every time I write it, so included here are primarily the fundamentals from miscallaneous sources.
A Shell Script is essentially a set of unix programs running sequentially, with control flow. It can be saved to any filename (though preferably one with a .sh
extension,) and made executable with chmod +x <filename>
. The first line in any shell script should be #!/bin/sh
. (Do note that you can also specify zsh, bash, csh, etc.)
Single line comments, the only comments, begin with an octothorpe #
. The echo
program is called to send standard output.
# Here, I'll print a simple string:
echo "a simple string. No semicolon needed."
…Aaaand, I’ll get to the rest of this page eventually. I’ll just leave one of my favourite quotes here:
…and my Dad always used to say, if you think the World should be a certain way, you have to be a part of the change you want to see in the World, or you should shut the fuck up and stop bitching about it.
CC BY-SA 4.0 - This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. You are free to share, redistribute and adapt the material as long as appropriate credit is given, and your contributions are distributed under the same license.