You shouldn't use a single variable to hold a list of options. Whenever you have a list of items, use an array instead.
(But actually, variables (including arrays) are intended for data, not code. While it's usually ok to store options in a variable, functions should be used for setting up complex commands.
http://mywiki.wooledge.org/BashFAQ/050 )
Also,
$(..) is highly recommended over `..`
useless use of cat. You can generally just use file redirection.
Oh, And I think it's also generally recommended to make your variables lower or mixed case, to avoid conflicts with preset shell variables, which are almost universally uppercase. I personally think too many upper case words is hard to look at.
Code:
#!/bin/bash
infile=/var/log/squid3/access.log
run_calamaris() {
local day=$( date +"%a" )
local -a calamarisoptions
calamarisoptions+=( '-a' '--config-file' '/etc/calamaris/calamaris.conf' )
calamarisoptions+=( '-F' 'html-frame' '--output-path' '/var/www/calamaris' )
calamarisoptions+=( '--output-file' "$day.html" )
/usr/bin/calamaris "${calamarisoptions[@]}"
}
run_calamaris <"$infile"
I believe it should work as written, as long as the command in the function takes input from stdin (and there's only one that does so).