Making flags for my script

I have no idea how to make my own flags.

I'm tempted to suggest needle and thread, but that wouldn't be helpful.

We need more information. Could you state what you mean? Could you explain what you're trying to do? Could you tell us what shell you're using?

okay well im autmating the backup of log files and itll run fine most of the time in the middle of the night but i want to make flags if i need to manualy run the script if i want to run past a certain time and also if i want to only visit an individual server. im using bash.

Commandline paramaters show up as $0, $1, $2, etc. ./something.sh a b c would have "a" as $0, "b" as $1, "c" as $2. $# is the number of parameters.

I think he wants to write something to a log, then use that information to restart the job at the point it died. Correct?

Not exactly i want it to run with differnt vars and conditions depending on what flags i put out there. So i guess if i want to change vars according to a flag just do a case with the flags i want the $1... to match. but what happens if i change the order. because if i run the script "script -y -t" as i understand $1=y and $2=t so the case would only check for changing vars according to the order i put them in. How would i make it not order dependant.

man getopts