26 Feb
2010
26 Feb
'10
2:52 a.m.
On Thu, Feb 25, 2010 at 09:05:11PM -0500, Ray Kohler wrote:
On Thu, Feb 25, 2010 at 7:25 PM, Allan McRae <allan@archlinux.org> wrote:
does: su -c "$PACMAN $PACMAN_OPTS $@" not work?
No, that somehow gets parsed as:
su -c 'pacman -U' pkgname
Which makes su complain that there's no such user as pkgname. I found no other way to get the whole command into a single string other than stuffing it into another variable as I did, and I spent over an hour trying various things.
That's the result of the "$@". This should work: su -c "$PACMAN $PACMAN_OPTS $*" The normal advantages of using "$@" over using "$*" would have been eliminated in this context, anyway. -- Jim Pryor profjim@jimpryor.net