shell scripts and comand arguments
john at jrochester.org
Mon Jun 2 09:07:32 BST 2003
On Sunday, Jun 1, 2003, at 14:53 Europe/London, Jonathan Belson wrote:
> I was making some tweaks to a script I wrote to 'mhonarc' freebsd-*
> mailing lists, when I ran into a problem with substitutions. Here's
> an example:
> title="$list archive"
> args="-title \"$title\" -add . -outdir ."
> mhonarc $args
> $args expands to
> -title "freebsd-ports archive" -add . -outdir .
> which is what you'd expect, but mhonarc sees
> -title "free-ports
> followed by
> which confuses it no end.
> Is there a simple solution to this problem or must I do it another way?
You need sh to pass this through another parsing stage to catch the
Change the final line to
eval mhonarc "$args"
and it should work.
More information about the Ukfreebsd