Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

share|improve this question

closed as too broad by Ramesh, terdon Oct 6 '14 at 15:10

There are either too many possible answers, or good answers would be too long for this format. Please add details to narrow the answer set or to isolate an issue that can be answered in a few paragraphs.If this question can be reworded to fit the rules in the help center, please edit the question.

"A simple script written using very advanced methods" does not sound very probable to me... – nico Apr 26 '11 at 15:12
ha ha Don't get me wrong , i mean to say i want to know advanced method writing – Mirror51 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
up vote 8 down vote accepted

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.

share|improve this answer
thanks for that , but do i have to read all 8oo pages for advanced bash scripting guide , its too much – Mirror51 Apr 26 '11 at 16:35
It's possible to use bash securely? :P – Joseph Garvin May 22 '11 at 20:21
+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
@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.

share|improve this answer
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 :-).

share|improve this answer

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.

share|improve this answer

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