Maybe I'm too sleep deprived to make sense of what I'm reading,
but...
<snip>
On 2014-06-10 16:12, Karanbir Singh wrote:
> On 06/10/2014 03:08 PM, Pat Riehecky wrote:
>> From: Pat Riehecky <riehecky@fnal.gov>
>> +#####################################################################Shouldn't this be quoted (or just `for arg;`)?
>> +# setup args in the right order for making getopt evaluation
>> +# nice and easy. You'll need to read the manpages for more info
>> +args=$(getopt -o hr -- "$@")
>> +if [[ $? -ne 0 ]]; then
>> + usage
>> +fi
>> +eval set -- "$args"
>> +
>> +RHELTAG=0
>> +for arg in $@; do
Otherwise, why not just use `$args` and skip the `eval set ...`?
>> + case $1 in<snip>
>> + -- )
>> + # end of getopt args, shift off the -- and get out of the loop
>> + exit 1More missing quoting?
>> +fi
>> +
>> +msg=$(git log --pretty=format:"%s")
>> +pkg=$(echo ${msg} | cut -d' ' -f2)
>> +In addition to the already mentioned missing $:s, there should
>> +if [[ ${RHELTAG} -eq 0 ]]; then
>> + thispkg=(echo ${pkg} | head -1)
>> +elif [[ ${RHELTAG} -eq 1 ]]; then
>> + thispkg=(echo ${pkg} grep -v centos | head -1)
presumably be a pipe before that `grep`, and unless that `head`
is redundant, `${pkg}` should be quoted.
(Unless there's some portability issue I'm missing, isn't
`grep -v -m 1 -e centos` equivalent?)