From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from hawkwind.utcs.toronto.edu ([128.100.102.51]) by archone.tamu.edu with SMTP id <45325>; Sat, 18 Apr 1992 17:45:23 -0500 Received: from localhost by hawkwind.utcs.toronto.edu with SMTP id <2715>; Sat, 18 Apr 1992 18:45:00 -0400 To: rc@archone.tamu.edu Subject: My programming challenge: the motivation Date: Sat, 18 Apr 1992 17:44:46 -0500 From: Chris Siebenmann Message-Id: <92Apr18.184500edt.2715@hawkwind.utcs.toronto.edu> I neglected to write out in full that newlines are allowed in the string, and that all such newlines *must* be preserved. The motivation for this exercise is to write code that can correctly handle *all* filenames it may get handed, and manipulate the result. Consider, for example, handing a loop of the form: for (i in $*) { x=`{basename $i .blorf} ... } a filename that has a newline in it. We can get the 'full' name back from basename with x=`` () {basename $i .blorf} but it will have an extraneous trailing newline on the end; we need to be able to strip this off, while leaving everything else untouched. And there's the problem. - cks