shell scripts and comand arguments
frank at esperance-linux.co.uk
Sun Jun 1 23:54:36 BST 2003
On Sun, Jun 01, 2003 at 02:53:11PM +0100, 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?
Well, you definitely have to do it another way :)
2 suggestions to try:
which may or may not work.
args="-title \"$list archive\" -add . -outdir ."
which I think will, & is better IMO. I don't see there being any future
in assigning a (presumably) unchanging string (" archive") to a variable.
Tel: 01423 323019
PGP keyID: 0xC0B341A3
More information about the Ukfreebsd