Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84 exptools; site ihdev.UUCP Path: utzoo!watmath!clyde!cbosgd!ihnp4!ihdev!pdg From: pdg@ihdev.UUCP (P. D. Guthrie) Newsgroups: net.unix Subject: Re: Help! Csh is eating my brain.... Message-ID: <362@ihdev.UUCP> Date: Fri, 18-Oct-85 12:34:07 EDT Article-I.D.: ihdev.362 Posted: Fri Oct 18 12:34:07 1985 Date-Received: Wed, 23-Oct-85 03:56:08 EDT References: <366@zaphod.UUCP> Reply-To: pdg@ihdev.UUCP (55224-P. D. Guthrie) Organization: AT&T Bell Laboratories Lines: 22 In article <366@zaphod.UUCP> flory@zaphod.UUCP (Trevor Flory) writes: >Hello All; > I'm trying to debug a csh script written by someone who > knew what he was doing I'm sure. Below is a fragment of > the script which I find rather difficult to understand: > ... > alias readandset 'echo -n \!:1 ; set \!:2 = $< ' > ... > readandset "Choice? " chvar > ... > if("$chvar" == "quit") .... > > In particular I'd like to know what \!:1 or \!:2 means/does. > This notation simply replaces itself with the corresponding arguments in the original line, so it echos the first argument, and sets the second one to a line from stdin. Why doesn't ksh have something like this? I hate having to use fc and mess around with its output - and that's soooo inefficient! Paul Guthrie