[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

getopts exclusive flags

From: Chris Jones
Subject: getopts exclusive flags
Date: Sat, 25 Oct 2008 22:42:49 -0400
User-agent: Mutt/1.5.13 (2006-08-11)

How do I handle mutually exclusive flags with getopts?

How do I handle the absence of flags?

I'm writing a script that normally runs from cron and backs up my hard

But I'd like to be able to run it manually and specify via flags the 
backup I want to run - daily or monthly.

$ backup -d     # daily backup
$ backup -m     # montly ..

So the script is run without any options specified by cron but I'd like
to be able to run it with two mutually exclusive flags from the command


reply via email to

[Prev in Thread] Current Thread [Next in Thread]