From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Fri, 9 Mar 2007 02:00:37 -0500 From: Kris Maglione To: 9fans@cse.psu.edu Subject: Re: [9fans] How can I shift a variable other than ? Message-ID: <20070309070037.GB12719@kris.home> References: <5730c50be46c467c6efe43925beb1b7c@coraid.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="/NkBOFFp2J2Af1nK" Content-Disposition: inline In-Reply-To: <5730c50be46c467c6efe43925beb1b7c@coraid.com> User-Agent: Mutt/1.5.13 (2006-08-11) Topicbox-Message-UUID: 1d3d98be-ead2-11e9-9d60-3106f5b1d025 --/NkBOFFp2J2Af1nK Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Mar 09, 2007 at 12:31:59AM -0500, erik quanstrom wrote: >that's a very elegant solution. but alas, It has its flaws, but it's useful in many circimstances nonetheless.=20 I've used, named tl, instead, a few times when I new the first argument=20 to a fn would be a word, and I needed to shift it off, and as the=20 following arguments had been parsed by the shell to begin with, I knew=20 they'd be parsed the same again. Nevertheless, here's an unpleasant rc solution: fn myshift { * =3D $$1 eval 'shift; '$1' =3D $*' } Or, you can just use sh(1), where you have ${tl}, subfn, (hd tl) :=3D list and so forth. --=20 Kris Maglione There is no safety in numbers, or in anything else. --/NkBOFFp2J2Af1nK Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.2 (FreeBSD) iD8DBQFF8QYVseQZD8Aui4wRAjBmAJ93gfRZvilggXQ+MrVhwGSY3W3T9ACdGEh1 JK7WKnS17a7jxwfZgdVO+Yo= =j38f -----END PGP SIGNATURE----- --/NkBOFFp2J2Af1nK--