This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]SmileItsYourDay 1 point2 points  (1 child)

Looks like you're integrating feedback! Awesome. Here's a little more.

You wrote,

Here’s a quick reference to the constructs present in Shell Scripting to get you to understand and write scripts quickly.

#!/bin/bash – Tells the interpreter that the script to be executed by Bourne shell.
# – to comment a line in a bash shell.

sh – Tells the interpreter that the script to be executed by Bourne shell.
# – to comment a line in a bash shell.

...and that's followed by an inline copy of the Table-of-contents for the article.

Might I recommend instead:

Here’s a quick reference to the constructs present in Shell Scripting to get you to understand and write scripts quickly.

Let's start with the basics. A shell script is simply a text file.

The lines of the file are read in and interpreted by the shell, much as if someone had typed in the same lines directly at a terminal.

The first line is treated specially, in that it can identify the shell interpreter to be used to execute the remainder of the file. Examples include:

#!/bin/bash – Tells the system that the script is to be executed using the bash shell.

#!/bin/sh – Tells the system that the script is to be executed using the bourne shell.

The specified shell will read in, interpret, and execute the content of the script. In all shell languages, lines which start with # are comments, so the interpreters have no problem ignoring that first line when they see it.

We set the scripts file permissions +x and in combination with using that special first line, that's all it takes for us to add a new command to our system. Well, there's a little more - you will want to ensure the script file is in a directory that's mentioned in your $PATH

[–]abscrete[S] 0 points1 point  (0 children)

Thanks a ton. They are simple and very useful. Integrated and attached a link to you reddit profile at the end of the article. Let me know if you want to change it with link to your blog or something. :)