digital adj. Having digits.     peer n. A comrade; a companion; a fellow; an associate. inmotion    
   
Recent Articles
Handling a Subversion Repository URL Change
Sunday, May 3, 2009
If your repository URL changes, you can use the following command to fix existing snapshots.
vfat Mounts Default to Lowercase Shortnames
Tuesday, April 21, 2009
I want a "this is brain-damage" quote from Linus for this mess.
VirtualBox or VMWare Virtual Machine at Login
Sunday, April 12, 2009
How to start a virtual machine in X when a user logs in.
Dialog Progress Bar Through Pipe
Sunday, April 12, 2009
How to use dialog to display a script progress bar and communicate progress to it through a named pipe.
Mount JFFS2 Image
Saturday, October 25, 2008
Example of how to mount a JFFS2 image using mtdblock.
Ottawa Linux Symposium 2008
Sunday, July 27, 2008
Here are some pictures from the 2008 Linux Symposium.
Linux Symposium 2008
Sunday, July 20, 2008
I'll be attending the Linux Symposium this year.
Clay Shirky: Institutions vs. collaboration
Monday, July 14, 2008
This is a rather interesting talk that takes some very foundational ideas from open source software development, P2P networks, and social networking and implies that these paradigms can apply to a lot more.

Who's General Failure and why's he reading my disk?

Sys Admin-Linux...-BASH Scripting

BASH Scripting

Saturday, July 17, 2004 by digitalpeer

This guide will grow and I get more time and as I run into new things.

The best place to get info on BASH scripting is the Advanced BASH Scripting Guide.

How to properly parse command line options. This is probably better than using the predefined variables such as $1 and $2 to get the command line options.
# Initial declaration.
# a, b, c, d, e, f, and g are the options (flags) expected.
# The : after option 'e' shows it will have an argument passed with it.
while getopts ":abcde:fg" Option
do
	case $Option in
   		a ) # Do something with variable 'a'.
		b ) # Do something with variable 'b'.
		...
		e)  # Do something with 'e', and also with $OPTARG,
		    # which is the associated argument passed with option 'e'.
		...
		g ) # Do something with variable 'g'.
	esac
done
shift $(($OPTIND - 1))
# Move argument pointer to next.

External Links Summary
Google Search: advanced bash scripting guide [www.google.com]

Submit Comment to This Article - Be the first!
Please post a comment if you have something to add, find something wrong, or would like more information on the topic at hand. Do not use the comment form to contact the author about unrelated concerns!

Name: Email (optional):
Enter verification number here: