From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: Date: Thu, 8 Mar 2007 03:41:42 -0500 From: "Russ Cox" To: "Fans of the OS Plan 9 from Bell Labs" <9fans@cse.psu.edu> Subject: Re: [9fans] How can I shift a variable other than ? In-Reply-To: <5ad6cc905af785ea7998576ecc08b401@orthanc.cc.titech.ac.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <5ad6cc905af785ea7998576ecc08b401@orthanc.cc.titech.ac.jp> Topicbox-Message-UUID: 1b1e9f06-ead2-11e9-9d60-3106f5b1d025 > shift in rc only shifts the command line argument ($*). > How can I shift other variable in rc? > I would like to do something like this: > > a=(a b c) > shift a 2 > echo $a > > and the echo should yield "b c". It's clumsy but it works: a=(a b c); *=$a { shift; shift; a=($*) } Russ