Ok, hopefully someone is still feeling generous enough to help with a few new syntax questions...

I'm modifying the script to check for trailer that have been updated (trailer 2 etc..) and I have the checks for that working fine using posting dates. Now I need to provide an OR condition when it comes time to save the downloads.

The existing IF is this:

Code:
if ! grep -q "###$MOVIEID.PREVIEW" $DLDBPATH.downloaded.db; then


I would like to include an OR for variable $getUpdate equal to 1.

I've tried a couple of things that didn't work, such as this:

Code:
if ( ! grep -q "###$MOVIEID.PREVIEW" $DLDBPATH.downloaded.db ) || [ "$getUpdate" -eq "1" ]; then


and this

Code:
if (( ! grep -q "###$MOVIEID.PREVIEW" $DLDBPATH.downloaded.db ) || [ "$getUpdate" -eq "1" ]); then


The error produced is: "integer expression expected" - which is unexpected to me since an integer is what I thought I was expressing. wink

In an earlier part of the script I'd like to check if xmlstarlet fails to open an input file.

Code:
		oldPostDate=(`$XMLSTARLET sel -E utf-8 -D -T -t -m "/records/movieinfo" \
			-v "info/postdate" \
			"$MOVIESAVEPATH/description.xml" `)


Even when this produces an error the script works, but I'd like to skip performing a few steps if this isn't able to pull the data I'm expecting.

Lastly, with regards to the same call just posted above, does anyone know any way that I can pass in the variable $MOVIESAVEPATH if it contains an apostrophe (single quote)? Will I have to massage it first to escape out that character before using it with xmlstarlet? It's a valid filename character but if one exists, it causes xmlstarlet to interpret it as a quote which then causes the syntax and passed params to break.
_________________________
Bruno
Twisted Melon : Fine Mac OS Software