Quote:
Originally Posted by puffinman
Not quite sure exactly what you mean, but is it something along these lines?
Code:
getDetails() {
OUTFN=$1;
shift;
for arg in $*;
do
#do whatever you want to do here...
echo $arg >> $OUTFN
done
}
|
Use "$@" not $*, printf rather than echo, and quote your variables:
Code:
getDetails() {
OUTFN=$1;
shift;
for arg in "$@"
do
#do whatever you want to do here...
printf "%s\n" "$arg"
done > $OUTFN
}