The difference is:
Quote:
Originally Posted by test.sh
#! /bin/bash
for i in $@ ; do
echo "'$i'"
done
echo "With quotes"
for i in "$@" ; do
echo "'$i'"
done
|
results in:
Quote:
./test.sh fooba "duuba" "dooba du"
'fooba'
'duuba'
'dooba'
'du'
With quotes
'fooba'
'duuba'
'dooba du'
|
You can see that "dooba du" will be used as two arguments with $@, one arg with "$@" which is kinda strange 'cause $@ sould do exactly this (quoting arguments), but it is reproducable on a number of systems.
Have you tested using
Quote:
arg=''
for i in "$@" ; do
j=`echo $i | sed 's/ /\\ /'`
arg=$arg $j
done
a2ps ... $arg
|
or something similar with escaping, not quoting, the strings? Or using both? (arg=$arg '$j') as it could be a similar problem with multiple scripts run after each other?
e.g. a2ps running "a2pdfwr $@" or whatever.
I can't test it myself, my ps2pdfwr seems to work