> test "x$foo" != "x"
I'm in the habit of writing it like this:
test x"$foo" != x""
Harlan Stenn <[EMAIL PROTECTED]>:
> 2> I'm in the habit of writing it like this: test x"$foo" != x""
> And exactly why are you using both the quotes and the x?
quotes because this fails:
foo='hi there'
test x$foo = xbar
x because this fails:
foo='!'
test "$foo" = "bar"
It's always safe
Akim Demaille <[EMAIL PROTECTED]>:
> In fact I've thought all the RE engines were the same, so a failing
> sed would be a failing egrep. But actually the problem we faced was
> an anchor inside a paren group, which I had generalized a bit too fast
> to all the `complex' structures. Maybe alterna
Alexandre Oliva <[EMAIL PROTECTED]>:
> BTW, this won't work as expected if `configure' is generated on
> platforms that use CR+LF as line separators. We should probably try
> to find some way that does the right thing even in such contexts.
how about
IFS=`echo 'abc' | tr 'abc' '\040\011\012'`
Alexandre Oliva <[EMAIL PROTECTED]>:
> This assumes ASCII. We've just removed the latest assumptions of
> ASCII, so it wouldn't be wise to re-introduce them :-)
oh. hmm. then how about using awk?
IFS=`awk 'BEGIN { printf " \t\n" }' /dev/null`
--
Alexandre Oliva <[EMAIL PROTECTED]>:
> > IFS=`awk 'BEGIN { printf " \t\n" }' /dev/null`
> Did you know that shells do eat up trailing new-lines, and that's why
> we can't do it this way? :-)
so reverse it.
IFS=`awk 'BEGIN { printf "\n \t" }' /dev/null`
--
Alexandre Oliva <[EMAIL PROTECTED]>:
> I think awk is overkill for that, since it can be done with plain
> echo. Moreover, I'm not really sure `\t' and `\n' are portable AWK.
well, I'm not fond of embedding tabs in scripts. \t and \n
should be portable awk. they were in the original awk.
--
Akim Demaille <[EMAIL PROTECTED]>:
> - Ideal cross compiling situation:
> The user said --host. This gives a better control than build != host.
what if I'm specifying --host because for some reason I
don't like the string that config.guess comes up with?
for instance, I'm building on a sparc-
Akim Demaille <[EMAIL PROTECTED]>:
> PS/ I have a bizarre demand to make: does anybody know a means for me
> to have an access to a wide set of old systems?
how about, work for a company that supports them? cygnus
has a couple of old systems lying around. no 4.3bsd though.
perhaps it would be
Donn Terry <[EMAIL PROTECTED]>:
> The current partial solution involves having two the-same-but-different
> versions of the same string, with different levels of \ quoting
> of ` (to allow nesting of `).
what do you gain from nesting `` that you can't do by using
temp variables? I can't think of
Donn Terry <[EMAIL PROTECTED]>:
> Sort of as a poll: on what systems is the getconf
> command not present, and which ones have it but not
of the systems I have easy access to, these are the oldest
that have it and the newest that don't.
aix 4.2 /bin/getconf
hpux 10.01
Donn Terry <[EMAIL PROTECTED]>:
> I don't follow. The inner echo outputs the value of the
> CC macro, and munges it for the "stage" change. The outer
> echo makes it a string (as opposed to a command to be
> executed) to pass it to the second sed to do .. insertion.
sorry, that makes no sense t
Donn Terry <[EMAIL PROTECTED]>:
> SUBDIR_FLAGS_TO_PASS = $(ORDINARY_FLAGS_TO_PASS) \
> "CC=$$(echo @cc_set_by_configure@ |
> $(PREPEND_DOTDOT_TO_RELATIVE_PATHS) )"
oh, I see. you didn't mention @cc_set_by_configure@ in your
original example. ok. hmm...
this is ugly, but seems to work,
Donn Terry <[EMAIL PROTECTED]>:
> That would be nice... in fact configure HAS done a meta
> build to presumably fix as much as it can. However, CC can
> be passed in on the make command line, and thus needs to be
> munged at make time, so the munging needs to be in the makefile.
or you can use a
[EMAIL PROTECTED] (Paul D. Smith):
> I'm a little concerned that the & token isn't supported by all versions
> of sed, either, but I couldn't find any examples... anyone have thoughts
> on the portability of that?
s//&/ has been in ed forever, so it should be in all
versions of sed too.
--
Donn Terry <[EMAIL PROTECTED]>:
> PREPEND_DOTDOT_TO_RELATIVE_PATHS = sed \
> -e 's|^ *[^ /][^ /]*/|%&|' \
> -e 's| -B| -B%|g' \
> -e 's|% *[^- /]|%&|g' \
> -e 's|%% *|../|g' \
> -e 's|%||g'
> SUBDIR_FLAGS_TO_PASS = $(ORDINARY_FLAGS_TO_PASS) \
> "CC=$
Felix Lee <[EMAIL PROTECTED]>:
> cc_0=`echo "$(CC)" | sed -e 's/^/cc0:/'`
> # or this:
> #cc_0=testing
>
> PREPEND=sed -e 's/^/pre:/'
> FLAGS=
> first:
> make $(FLAGS) next
>
Akim Demaille <[EMAIL PROTECTED]> wrote:
> BTW, what is the right spelling?
> Built-in, builtin, built in. What is the plural?
www.m-w.com says 'built-in'. elision of hyphens is typical
in language evolution, so 'builtin' may eventually become
'normal' english.
no special plural noted for the
Alexandre Oliva <[EMAIL PROTECTED]>:
> if (cd c:\\ && cd .. && test `pwd` = "C:\\") 2> /dev/null
there doesn't have to be a c:. I've seen a system where the
only disk is a hard drive named a:.
--
Akim Demaille <[EMAIL PROTECTED]>:
> I'm sorry, but I disagree. The only sane and simple definition of
> cross-compilation is when --host is specified.
so what do you do if config.guess is wrong and you want to
specify the --host string exactly, but you don't want a
cross-compile?
--
Alexandre Oliva <[EMAIL PROTECTED]>:
> If your problem is with the result of config.guess, what you want to
> specify is --build, not --host, because config.guess can only guess
> that the build platform is.
ok, that's fine.
--
Lars J. Aas writes:
> : -for warning in `IFS=,; echo syntax,$WARNINGS,$warnings | tr [A-Z] [a-z]`
> : +for warning in `IFS=,; echo syntax,$WARNINGS,$warnings | tr '[A-Z]' '[a-z]'`
> Why use the braces at all? Are they really necessary? tr A-Z a-z has
> always worked for me, and that format won't
appears to work on sunos 4.1.4
btw, the length limit is 120 bytes, not 128.
Paul Eggert <[EMAIL PROTECTED]>:
> We could use AWK as a fallback if the standard tools fail. However, I
> think we can do it with the standard tools. The following works for
> me, using Solaris 8 /usr/ucb/expr (sorry,
Akim Demaille <[EMAIL PROTECTED]>:
> Earnie> Not all. Only some. Akim's posts are being repeated.
>
> ??? If someone has some clues, please tell me what I should do/check.
doesn't look like your fault. message-ID is the same, all
the headers are the same up to fencepost.gnu.org, and at
fence
24 matches
Mail list logo