LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Noobs Guide to Bash-Scripting (https://www.linuxquestions.org/questions/linux-newbie-8/noobs-guide-to-bash-scripting-633161/)

penguinboy08 04-04-2008 09:41 PM

Noobs Guide to Bash-Scripting
 
I've added more to my series of bash-scripting tutorials! Hopefully this can help some people get on the right track, I've tried to start from the very basics, and we're progressing on to the more interesting stuff.

Part 1

Part 2
Part 3

I will be updating this post as I write some more parts! Comments are much appreciated.

raskin 04-05-2008 01:14 AM

Well, where you explain "for", you could also explain its use with explicit list. Or $(seq 1 10) .. Because the fact that for is applicable not only to * can be a small stumbling block for beginning shell programmers.

penguinboy08 04-06-2008 01:26 AM

Yea, thanks for the tip. I'll include that when I next get the chance. :D

archtoad6 05-12-2008 05:54 PM

Great work
 
Over all, v.v.v. good.
Here are some suggestions.
Hope none are too harsh; remember, I wouldn't have bothered if I didn't think your piece is worth the trouble.


Title typos
Quote:

The Noobs Guide to Bash-Scripting
should be:
Quote:

The Noob's Guide to Bash-Scripting

Title content
Although I am in a tiny minority here, I think "noob" is a totally offensive term, see http://www.catb.org/jargon/html/N/newbie.html & realize that in the "British public-school" context, there may have been an implied right of upperclassmen to sodomize the newbie. Compare "fresh fish" in The Shawshank Redemption.


Part 1 typos
Quote:

Enough talking, lets get started!
should be:
Quote:

Enough talking, let's get started!

Quote:

check out it's man page:
should be:
Quote:

check out its man page:

Part 1 content
Personally, I would explain in more depth:
shebang (also called a hashbang, hashpling, or pound bang) both the nomenclature & the reason. I wouldn't be embarrassed to reference the Wikipedia.

Why chmod & ./$SCRIPTNAME are necessary.


Part 2 typos
Quote:

For instance, lets say
should be:
Quote:

For instance, let's say

Quote:

Arguments can be easily accessed in the script, they are automatically assigned to a variable.
should be:
Quote:

Arguments can be easily accessed in the script, they are automatically assigned to variables.

Part 2 content
Quote:

What the fart is a variable?
could just as well be:
Quote:

WTF is a variable?

"Variables can be created very easily:" . . .
I'd be happier if you stuck w/ the bash convention of capitalizing variable names & didn't model the, to a shell scripter, abominable long variable names from the C family:
Code:

example_variable="example_value"
echo $example_variable

would become:
Code:

VAR="example_value"
echo $VAR


"Along with the argument variables,"
You need to mention that argument variables are perversely called "parameters" in bash -- particularly in its man page.
(Thumbs up for calling them "arguments".)


Part 3 typos
Quote:

order to be review and compiled
should be:
Quote:

order to be reviewed and compiled

Quote:

It's standard form is this:
should be:
Quote:

Its standard form is this:

Quote:

hesitate to email me,
should be:
Quote:

hesitate to e-mail me,
I know, some think this is just a matter of taste; but AFAIAC, "email" is illiterate, because it implies the wrong pronunciation of the word.


Part 3 content
Quote:

In our scenario we are a programmer working with a smallish team of like-minded programmers.
Cool, the royal/editorial "we" correctly used.


And of course, I hope I have proofed & spell checked this enough . . .


All times are GMT -5. The time now is 11:50 AM.