I am looking for some tutorial where a simple script is written using very advanced methods so that i can learn more from
-
4"A simple script written using very advanced methods" does not sound very probable to me...nico– nico2011-04-26 15:12:19 +00:00Commented Apr 26, 2011 at 15:12
-
1ha ha Don't get me wrong , i mean to say i want to know advanced method writingMirage– Mirage2011-04-26 16:40:28 +00:00Commented Apr 26, 2011 at 16:40
-
of course, I got what you meant, it just sounded a bit strange! ;)nico– nico2011-04-26 17:24:34 +00:00Commented Apr 26, 2011 at 17:24
-
The book "object oriented shell programming" is a good entry to higher level advanced shell programmingFlorian Heigl– Florian Heigl2018-06-06 12:08:29 +00:00Commented Jun 6, 2018 at 12:08
4 Answers
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 muchMirage– Mirage2011-04-26 16:35:52 +00:00Commented Apr 26, 2011 at 16:35
-
It's possible to use bash securely? :PJoseph Garvin– Joseph Garvin2011-05-22 20:21:08 +00:00Commented May 22, 2011 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– helpermethod2013-02-04 12:40:53 +00:00Commented Feb 4, 2013 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– l0b02013-02-04 16:02:35 +00:00Commented Feb 4, 2013 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– mikeserv2014-08-23 05:01:48 +00:00Commented Aug 23, 2014 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.