Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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
1  
"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 –  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

4 Answers 4

up vote 6 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 I've ever seen, 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  
+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 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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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