awk vs. cut

"Alfredo Tripicchio @ Pointel" <[email protected]> Wed, 6 Oct 2004 10:28:03 +0200
Newsgroups gmane.comp.sysutils.backup.sarab
Message-ID <002b01c4ab7e$6639ceb0$13c9a8c0@TRIPICCHIO>
Hi List,

I tried the patched version of sarab.sh, but still had problems with awk, 
until I changed the double quotes in single quotes, that is:
CURRENT_ARCHIVE=$(echo $CURRENT_LINE | awk '{print $1}')
instead of
CURRENT_ARCHIVE=$(echo $CURRENT_LINE | awk "{print $1}")
and so on for the other occurrences of awk.

I also had to delete the double quotes from $NUM_FIELDS, that is
if [ $NUM_FIELDS = "2" ]; then
instead of
if [ "$NUM_FIELDS" = "2" ]; then

After these modifications the script was able to split the lines of 
rotation.schedule and create incremental/differential backups when needed.

Hope this helps.
Regards,
Alfredo Tripicchio 



-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl