I'm trying to execute this command in in a bash script
find /var/log/apache2/access*.gz -type f -newer ./tmpoldfile ! -newer ./tmpnewfile | xargs zcat | grep -E '$MONTH\/$YEAR.*GET.*ad=$ADVERTISER HTTP\/1' -c
If i execute it directly or assign it to a variable it returns 0
But if i do a echo of the command (with the variables replaced by the script) and execute it in the command line it works.
echo "find /var/log/apache2/access*.gz -type f -newer ./tmpoldfile ! -newer ./tmpnewfile | xargs zcat | grep -E '$MONTH\/$YEAR.*GET.*ad=$ADVERTISER HTTP\/1' -c"
How shold i code it for work
-execargument forfind