Path: utzoo!attcan!uunet!mcvax!hp4nl!botter!star.cs.vu.nl!maart From: maart@cs.vu.nl (Maarten Litmaath) Newsgroups: comp.unix.questions Subject: csh joke (was: quoting $ in the Csh) Message-ID: <1812@solo9.cs.vu.nl> Date: 14 Dec 88 16:42:17 GMT References: <1233@paris.ics.uci.edu> <1799@solo9.cs.vu.nl> <879@ubu.warwick.UUCP> Organization: V.U. Informatica, Amsterdam, the Netherlands Lines: 32 mirk@warwick.UUCP (Mike Taylor) writes: \ alias cart 'rn -c -s999 | awk \'{x+=$5}; END {print x}\'' \No deal. I can't say exactly what is going wrong here, but for some reason, \(Any of you Toreks/Spencers out there like to explain) csh(1) decides that \quoting the inner 's with \ isn't good enough, and spits back a "Unmatched \single quote" error at you. Inside single quotes a backslash isn't treated specially, EXCEPT when followed by your first `histchar', usually an exclamation mark; so csh breaks up the command above as follows: alias cart 'rn -c -s999 | awk \'{x+=$5} ; # this semicolon delimits the alias command! END {print x}\'' The next command is `END', followed by an argument with an escaped single quote, and finally an UNMATCHED QUOTE! And now for the joke: % alias printf 'foreach i ( hello , world ! )\ echo $i\ end' % printf ... Better try it in a subshell... -- fcntl(fd, F_SETFL, FNDELAY): |Maarten Litmaath @ VU Amsterdam: let's go weepin' in the corner! |maart@cs.vu.nl, mcvax!botter!maart