What does this mean?
#!/bin/bash
BACKUPFILE=backup-$(date +%m-%d-%Y)
archive=${1:-$BACKUPFILE}
What does this mean?
#!/bin/bash
BACKUPFILE=backup-$(date +%m-%d-%Y)
archive=${1:-$BACKUPFILE}
The variable archive gets set to $1 if it exists otherwise if get set to "backup-$(date +%m-%d-%Y) (e.g. "backup.10-29-2009")
i would suggest reading up on bash parameter substitution... It's comes in really handy if you have to do a lot of manipulation with a single variable otherwise you have to add on a bunch of test logic.
Your question(s) could easily be answered by searching the Internet with Google. Google is your friend
Have a read of these links:
Regards
thanks:)