---- Original message ---- >Date: Thu, 14 Dec 2006 19:06:30 -0600 >From: "Matthew R. Dempsky" <[EMAIL PROTECTED]> >Subject: Re: ksh input control: read >To: misc@openbsd.org > >On Thu, Dec 14, 2006 at 12:55:42PM -0600, Jacob Yocom-Piatt wrote: >> print "testing" | read testread > >This is a known problem with pdksh that the developers have stated >they don't plan to change. `read' only updates the value of >`testread' in the child shell process, not the parent. > >E.g., ``print "testing" | ( read testread; echo $testread )'' will >work. >
yeah, after further reading i found that pdksh and ksh behave differently w.r.t. child shells. the syntax you suggest above is what i've already fiddled with and see that it can work. is there a ksh command that will print a variable, say $form_pw, with any combination of "bad" characters (e.g. `,',",%,>,<,|) stored in it? this seems like it would be a useful command since, AFAICT this issue is relatively common. if no command exists, i can certainly write some C code to do it but would rather see if it's doable using just ksh. is there a list of all the characters you should escape/filter when writing shell scripts?