HP3000-L Archives

May 2001, Week 4

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Mark Klein <[log in to unmask]>
Reply To:
Mark Klein <[log in to unmask]>
Date:
Mon, 21 May 2001 21:10:16 -0700
Content-Type:
text/plain
Parts/Attachments:
text/plain (41 lines)
Jeff followed up my post with:

>> /find_in_path.sh: /find_in_path.sh: not found
>>
>> Ah ... here's the culprit:
>>
>> ./devtools/bin/configure.sh:bin_dir=`echo $0 | sed -e
>'s/\/[^/]*$//'` >
>> Solve two problems with one fix! :-)
>
>Thanks!  But I will plead ignorance and ask, what is the one fix?
>And, how does this relate to the missing /find_in_path.sh file?

Sorry about the short response. :-)

The sed script takes the zeroth parameter to the script (in this
case, the full path name of the format /DIS/PUB/test.sh) and
then strips off the path portion (e.g. /DIS/PUB) and saves it
in the variable "bin_dir". Later, ${bin_dir}/find_in_path.sh
is invoked. So, if the sed script failed, ${bin_dir} would be
undefined. Hence, solve the sed script problem and you also
solve the "/find_in_path.sh: not found" problem.

In this case, MKS sed has a problem with a regular expression
that contains elements of the string to be parsed, even if
properly escaped. So, the "s/\/[^/]*$//" regular expression can
be modified to "s@\/[^/]*$@@" and will work with MKS SED.
Alternately, the delimiter can be one of a number of other fields
such as the % that Mark suggested. You'll find many of the GNU
scripts tend to use the @. Look at some of the autoconf stuff
as an example.


Regards,


M.

* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

ATOM RSS1 RSS2