GNU bug report logs - #20733
coreutils build problem

Previous Next

Package: coreutils;

Reported by: Paul Eggert <eggert <at> cs.ucla.edu>

Date: Thu, 4 Jun 2015 19:18:02 UTC

Severity: normal

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


Message #25 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Stephane Chazelas <stephane.chazelas <at> gmail.com>
To: bug-coreutils <at> gnu.org
Subject: Re: bug#20733: [PATCH] doc: mention 'for' syntax issue on older shells
Date: Thu, 4 Jun 2015 21:36:17 +0100
2015-06-04 14:06:03 -0600, Eric Blake:
[...]
> +$ @kbd{cat Makefile}
> +list =
> +bad:
> +	@@for arg in $(list); do echo $$arg; done
> +good:
> +	@@list='$(list)'; for arg in $$list; do echo $$arg; done
[...]

Another option is to use:

   for arg in $${-+$(list)}; do echo $$arg; done


That's ${var+value} that expands to value if var is set. $- is
always set. $0 could also be used instead.

-- 
Stephane





This bug report was last modified 10 years and 48 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.