#!/bin/bash > # accept one or three args function foo(){ if [ $# == 1 ];then > start=0 > finish=16 > cmd=$1 > elif [ $# == 3 ];then > start=$1 > finish=$2 > cmd=$3 > else > echo "Error Usage - 1 or 3 arguments" > exit 1 > fi > echo "start: $start finish: $finish cmd: $cmd :" > } > foo 1 2 3 > #start: 1 finish: 2 cmd: 3 : > foo 1 2 "foo bar baz" > #start: 1 finish: 2 cmd: foo bar baz : -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.mn-linux.org/pipermail/tclug-list/attachments/20101007/895a78ca/attachment.htm