From: Victor Eijkhout on
In bash, "set -- $x" where x="a b" causes the effect of
$1=a; $2=b

Given the value of x, is there a csh construct that does the same?

Victor.
--
Victor Eijkhout -- eijkhout at tacc utexas edu
From: Kenny McCormack on
In article <1jj68ot.kf16kr119ulbaN%see(a)sig.for.address>,
Victor Eijkhout <see(a)sig.for.address> wrote:
>In bash, "set -- $x" where x="a b" causes the effect of
>$1=a; $2=b
>
>Given the value of x, is there a csh construct that does the same?
>
>Victor.
>--
>Victor Eijkhout -- eijkhout at tacc utexas edu

set argv=($x)

--
> No, I haven't, that's why I'm asking questions. If you won't help me,
> why don't you just go find your lost manhood elsewhere.

CLC in a nutshell.

From: Victor Eijkhout on
Kenny McCormack <gazelle(a)shell.xmission.com> wrote:

> >In bash, "set -- $x" where x="a b" causes the effect of
> >$1=a; $2=b
> >
> >Given the value of x, is there a csh construct that does the same?
> >
> >Victor.
> >--
> >Victor Eijkhout -- eijkhout at tacc utexas edu
>
> set argv=($x)

Many thanks. No amount of reading the man page suggested the use of
parens.

Victor.

--
Victor Eijkhout -- eijkhout at tacc utexas edu
From: Barry Margolin on
In article <1jj6xin.bw9i1n18o8ds0N%see(a)sig.for.address>,
see(a)sig.for.address (Victor Eijkhout) wrote:

> Kenny McCormack <gazelle(a)shell.xmission.com> wrote:
>
> > >In bash, "set -- $x" where x="a b" causes the effect of
> > >$1=a; $2=b
> > >
> > >Given the value of x, is there a csh construct that does the same?
> > >
> > >Victor.
> > >--
> > >Victor Eijkhout -- eijkhout at tacc utexas edu
> >
> > set argv=($x)
>
> Many thanks. No amount of reading the man page suggested the use of
> parens.

From the man page on Mac OS X, which I assume is similar to other
systems:

set
set name ...
set name=word ...
set [-r] [-f|-l] name=(wordlist) ... (+)
set name[index]=word ...
set -r (+)
set -r name ... (+)
set -r name=word ... (+)

The fourth form shows using parens to set a variable to a list of values.

--
Barry Margolin, barmar(a)alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***