This is a short gist to teach basic scripting. It's meant for beginners. For each and every exercise, you should comment exactly what each line does.
Below is a list of concepts you should be familiar with, and should be able to answer.
- The Shebang: What is a shebang? Why should you use it in a script? What does it do?
- Variables: What are variables? How are they used?
- Built-In Variables: What are built-in(internal) variables?
- Start off by writing a simple 'Hello World' script called
helloworld.sh
. It should be able to be run by typing ./helloworld.sh in your terminal - Iterate on the script above so that it does the following: Prompt for your name, and greet you with 'Hello, <YOURNAME>!'
- Iterate on the script you just wrote so that it does the following: Takes input for 2 names, and then introduces those two names to each other. Example: Hi Bob, this is Tom. Tom, this is Bob.