Spotlight | Reviews | Current Issue | Newsletter | Subscribe | Contact
Departments


price comparison with idealo.com
Price comparison for:
fast servers for your business solution, fast notebooks for long flights, software for good results, TomTom navigation systems, PC hardware, Plasma and LCD TVs, Computer Hardware and Software, MP3 Player, highend Laptops and many more. Get reviews of your favourite digital camera or  of  new dvd-players.

user friendly

  linux-magazine.com » Issues » 2006 » 64 » SCRIPT WORKOUT  

Script tuning in Bash

SCRIPT WORKOUT

Author(s): MIRKO DÖLLE

In the old days, shells were capable of little more than calling external programs and executing basic, internal commands. With all the bells and whistles in the latest versions of Bash, however, you hardly need the support of external tools.

Many scripts treat Bash as if it were capable of little more than calling external programs. This is surprising, since version 2 of the default shell has a command set that covers everything from complex string manipulation, through regular expressions, to arrays; useful functions that make expensive program calls redundant. The main advantage of internal functions is that the shell does not need to spawn a new process, which saves processing time and memory. This capability can be important, particularly if you need to launch a program like grep or cut in a loop, as the completion time and memory consumption of a script can explode if you’re not careful. This article describes some simple techiques for speeding up your Bash scripts.


Read full article as PDF »


Comments


Slashdot it! Delicious Digg
Related Articles
SCRIPTING SECRETS New tools and techniques for scripting in Linux
PAINT YOUR BASH ANSI escape sequences
PRIMPED PROMPT Configuring the Bash prompt
SHELL GAMES Comparing Bash with the Windows Vista shell
Video Archive USENIX Security '08

Video Archive USENIX Security '08

Look here for archived tutorials and talks from USENIX Security '08. Each comprises a video and recorded presentation slides which are shown parallel to the talk.

Find out more

 

In the US and Canada, Linux Magazine is known as Linux Pro Magazine.
Entire contents © 2008 [Linux New Media USA, LLC]
Linux New Media web sites:
North America: [Linux Pro Magazine]
UK/Worldwide: [Linux Magazine]
Germany: [Linux-Magazin] [LinuxUser] [EasyLinux] [Linux-Community] [Linux-Nachrichten] [Linux Events]
Eastern Europe: [Linux Magazine Poland] [Linux Community Poland] [Darmowe Programy Poland] [Open Source DVD Poland] [Linux Magazin Romania]
International: [Linux Magazine Brazil] [Linux Magazine Spanish]
Corporate: [Linux New Media AG]