Re: Variable variable name
- From: "Chris F.A. Johnson" <cfajohnson@xxxxxxxxx>
- Date: Tue, 12 Sep 2006 14:41:04 -0400
On 2006-09-12, Samik R. wrote:
Chris F.A. Johnson wrote:
Thanks for your reply, Chris. I am using bash, so the 3rd comment is
Fourth, consider using the positional parameters to make your
script more portable:
set -f
set -- `cat "$file"`
applicable. Can you elucidate some more (or point to a reference) for
the fourth comment? I haven't used any of them earlier.
Using that method, each word of the file is placed into one of the
positional parameters, $1, $2, ..., ${10}, ${11}, etc., instead of
into a shell array (which most shells do not support, and is not
part of the POSIX standard).
--
Chris F.A. Johnson, author <http://cfaj.freeshell.org/shell>
Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)
===== My code in this post, if any, assumes the POSIX locale
===== and is released under the GNU General Public Licence
.
- Follow-Ups:
- Re: Variable variable name
- From: Samik R.
- Re: Variable variable name
- References:
- Variable variable name
- From: Samik R.
- Re: Variable variable name
- From: Chris F.A. Johnson
- Re: Variable variable name
- From: Samik R.
- Variable variable name
- Prev by Date: Re: Variable variable name
- Next by Date: Re: Parsing a char array w/fields delimited by /0xA
- Previous by thread: Re: Variable variable name
- Next by thread: Re: Variable variable name
- Index(es):
Relevant Pages
|