AboutWelcome to Free Software Daily (FSD). FSD is a hub for news and articles by and for the free and open source community. FSD is a community driven site where members of the community submit and vote for the stories that they think are important and interesting to them. Click the "About" link to read more...
Do you sometimes wonder how to use parameters with your scripts, and how to pass them to internal functions or other scripts? Do you need to do simple validity tests on parameters or options, or perform simple extraction and replacement operations on the parameter strings? This tip helps you with parameter use and the various parameter expansions available in the bash shell.
The Bash Debugger Project (bashdb) lets you set breakpoints, inspect variables, perform a backtrace, and step through a bash script line by line. In other words, it provides the features you expect in a C/C++ debugger to anyone programming a bash script.
Scripts are files that contain shell commands which may be short or can be very complex. Scripts just make it easier because you can invoke one command to run all of the commands in the script. Here instead of using 8 separate commands you can use one command to execute all of them.
Yesterday we took a look at BashDiff, a patch for the bash shell that adds new capabilities. We've already looked at some of the additions that BashDiff makes to bash's commands and string parsing abilities. Today we'll look at modifying positional parameters, parsing XML, talking to ISAM and relational databases, creating GTK+2 GUIs, and a few other tricks and issues.
By and large, most Red Hat Linux systems will have Bash as the default shell. Bash is a darn great shell, but this article is about another equally great shell, called Z-Shell, that has most of the attributes of Bash, but in some cases goes the extra mile to give you the flexibility to customize your shell more than Bash allows.
This isn't about a shell script, it's about a really cool technique to apply in shell scripts. Have you ever been worried about multiple instances of a shell script running because they might overwrite or corrupt the data or devices they are working on? Here's a way to prevent that.