Learning Bash

Hi all,

This post has moved. Sorry for not redirecting you myself! WordPress.com is a bit dumb when it comes to that.


Or click on the picture of spock :)


11 Responses to “Learning Bash”

  1. This is a good quick primer. It’s shorter and less complete than both the bash scripting handbook and the bash manpage, but those could each be seen as assets as well as detriments.

    You may want to include a link to the Advanced Bash Scripting Guide (http://tldp.org/LDP/abs/html/) as well as recommend people read ‘man bash’ for more information.

    Also, it would probably be good to explain the difference between
    . /path/to/script
    and just

    Overall, good coverage of 80-90% of everything most people use in scripts. Cool. I added your blog to my google reader. I’m looking forward to more content in the future!


    PS – got here from Reddit

  2. Bash arithmetic:


    Inside the double parens, you don’t need $ signs to denote variables.

    Same with the arithmetic conditionals:

    if (( i < j )) ; then ; fi

  3. Gar Morley Says:

    Nice post!

    The if statement at the start of “Part 4.) Loops” shouldn’t really be there. The if statement is a conditional statement, not a loop.

    You should check out Classic Shell Scripting from O’Reilly. Not alone is it my favourite shell scripting book, but I think it is one of my favourite tech books ever. Well worth a read.

    Keep up the good work!

  4. […] Bash shortcuts « Tales From a Cold Network Admin (tags: bash shell scripting) […]

  5. […] Bash shortcuts « Tales From a Cold Network Admin (tags: bash linux shell tutorial programming unix scripting sysadmin) […]

  6. Yay. Yet another bash tutorial… For a (hopefully) comprehensive list of slightly longer and more complete bash tutorials, along with reviews and rating by people that actually know bash very well, see:


  7. You might want to note that $USER is not always guarenteed to get the user name. It is only set in login shells, although there may be exceptions to this, so it is useful to know $LOGNAME which will also be the user name but is set in non-login shells (cron). I’m sure there are probably exceptions for LOGNAME as well :)

  8. […] Learning Bash « Tales From a Cold Network Admin (tags: bash linux scripting shell reference tutorial programming unix) […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: