I am looking for some tutorial where a simple script is written using very advanced methods so that i can learn more from

  • 3
    "A simple script written using very advanced methods" does not sound very probable to me... – nico Apr 26 '11 at 15:12
  • 1
    ha ha Don't get me wrong , i mean to say i want to know advanced method writing – Mirage Apr 26 '11 at 16:40
  • of course, I got what you meant, it just sounded a bit strange! ;) – nico Apr 26 '11 at 17:24
  • The book "object oriented shell programming" is a good entry to higher level advanced shell programming – Florian Heigl Jun 6 '18 at 12:08

Once you've graduated from the Advanced Bash-Scripting Guide, I'd suggest the much more useful Greg's Wiki (especially the Pitfalls article). It's the single most useful Bash resource out there (please someone prove me wrong), and significantly, is an active (and actively moderated) wiki with even anonymous editing.

As for simple scripts using advanced methods, it's difficult to judge what would be advanced for you. One of my own most advanced scripts was one find and loop over all files matching a user-provided path, in such a way that it would be impossible to craft a search string or filename to break the code or perform some sort of code injection (Unfortunately Bash gets really complicated if you want to use it securely). The script was documented to explain the reasoning behind all the non-trivial syntax, so it might have some learning potential. YMMV.

  • thanks for that , but do i have to read all 8oo pages for advanced bash scripting guide , its too much – Mirage Apr 26 '11 at 16:35
  • It's possible to use bash securely? :P – Joseph Garvin May 22 '11 at 20:21
  • 2
    +1 I can only second this. I've read tons of resources and books about Bash scripting but Greg's Wiki is by far the best resource I've found. Not only does it teach you Bash - the scripting language (in contrast to Bash - the glue language) it also goes into detail concerning pitfalls and portability considerations. – helpermethod Feb 4 '13 at 12:40
  • 1
    @JosephGarvin: I'd say so, but I wouldn't recommend it if you want security. It's fiendishly difficult to do even stuff like file name handling properly. – l0b0 Feb 4 '13 at 16:02

Rather than a book or tutorial, you might want to look at some of the init scripts that start up your machine. Understanding these will give you a good grounding in bash scripting and provide you with a lot more insight into how your machine runs -- and what you can do when it doesn't...

You can read a general overview of the whole process in this article, From Power Up to Bash Prompt.

  • Yes. Init is a wonderful place to learn. Thank you. – mikeserv Aug 23 '14 at 5:01

Not sure what very advanced methods would be, but I have the 'Expert Shell Scripting' by Ron Peters (available about anywhere).

I'm happy with it :-).


I’ve had good experience with bash Cookbook: Solutions and Examples for bash Users from O’Reilly. It has got the solutions to actual problems/situations that I have needed to resolve. All the recipes come with a discussion on why it was done this way; and many also has ways it could have been done differently. Case-by-case learning.

Pretty cheap as an ebook.

Not the answer you're looking for? Browse other questions tagged or ask your own question.