bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Command Scripting Question


From: Paul Jarc
Subject: Re: Command Scripting Question
Date: Thu, 27 Mar 2003 12:10:31 -0500
User-agent: Gnus/5.090017 (Oort Gnus v0.17) Emacs/21.2 (gnu/linux)

Casey McGinty <pcm6519@rit.edu> wrote:
> Please excuse me if this is not the correct place to post this question.

news:comp.unix.shell is a good place for help with scripting.

> options='--libs="-lresolv -ltermcap -static"'
> ./configure $options

Quotes lose their special properties when they are part of the
expanded value of a variable, command substitution, etc.  So your
command is equivalent to:
./configure '--libs="-lresolv' '-ltermcap' '-static"'

You could do this:
options='--libs=-lresolv -ltermcap -static'
./configure "$options"

Or, if you want options to be able to contain multiple arguments, and
you also want the arguments to be able to contain spaces:
options='--libs="-lresolv -ltermcap -static" ...'
eval "./configure $options"

The quotes in the value of $options will not be special when $options
is expanded, but they will be special when eval interprets its
argument.


paul




reply via email to

[Prev in Thread] Current Thread [Next in Thread]