Path: utzoo!attcan!uunet!lll-winken!ames!oliveb!3comvax!bridge2!jzs From: jzs@bridge2.3Com.Com (Jeremy A. Siegel) Newsgroups: comp.unix.questions Subject: Passing multi-line arguments through c-shell Keywords: options csh strings Message-ID: <259@bridge2.3Com.Com> Date: 16 Jan 89 16:50:59 GMT Distribution: na Organization: 3Com Corp., Mt. View, CA Lines: 24 How can I get a c-shell script to pass multi-line terminal input as a single argument to a program? Specifically: using Suns running SunOS 3.5 we use a script to admin files in sccs; I want to add use of the -y option to insert an initial comment. The -y works fine from the command line, using "" to delimit the string and \ to escape the newlines -- but I want to get user input as the line comment strings. I tried: ... -y"$<" ... but that only reads one line. I tried: ... -y"`cat`" ... but the output from cat contains newlines which break the string, and embedding \ didn't seem to do any good. I've finally ended up with: ... -y"`echo 'comments (end w/EOF(^D)): '; cat | tr '\012' ' '`" ... which of course makes everything a single line -- which seems to work, but doesn't look real pretty in the s-file (I don't know if there's an sccs limit on the line length -- I'd probably encounter a csh limit first). Various combinations of backquotes, double-quotes, and parens with echo and cat never quite produced what I want -- in all cases the c-shell would not pass newlines in the option string. So is there any way I can do this? Thanks, Jeremy Siegel 3Com Corp; ESD Mountain View, CA