Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site utcsrgv.UUCP Path: utzoo!utcsrgv!dave From: dave@utcsrgv.UUCP (Dave Sherman) Newsgroups: net.unix-wizards Subject: Re: /bin/sh variable substitution Message-ID: <4689@utcsrgv.UUCP> Date: Sun, 1-Jul-84 09:10:59 EDT Article-I.D.: utcsrgv.4689 Posted: Sun Jul 1 09:10:59 1984 Date-Received: Sun, 1-Jul-84 11:17:38 EDT References: <4260@mordor.UUCP> Reply-To: dave@utcsrgv.UUCP (& Sherman) Organization: The Law Society of Upper Canada, Toronto Lines: 34 In article <4260@mordor.UUCP> jdb@mordor.UUCP (John Bruner) writes: ~| I noticed recently that the (Bourne) shell's ${X=y} construction ~| does not have the behavior that I expected. It appears that when ~| a variable is assigned a quoted value, for example: ~| ~| ${XYZZY="plugh"} ${XYZZY='plugh'} ~| ~| that every character of the quoted value is stored with the 0200 ~| bit on. Normally this has no visible effect because the shell ~| strips the eighth bit (along with non-printable characters) after ~| variable substitution when it evaluates a command. However, this ~| is not the case for "<<" I/O redirection: the variables are passed ~| unfiltered. ~| Aha! That explains the strange behaviour I got on one system, where I was trying to use "cu" across a hardwired line, requiring a null first argument (nothing to dial). I can type to the shell: cu "" -s 2400 -l /dev/whatever but when I put CU='cu "" -s 2400 -l /dev/whatever' in my .profile, I couldn't get $CU to work, and the error meesage from cu was one I couldn't reproduce by typing at the screen. No amount of fiddling with different combinations of quoting chars helped. Musta been those eighth bits acting up. Yep, it's a bug. Dave Sherman Toronto -- {allegra,cornell,decvax,ihnp4,linus,utzoo}!utcsrgv!dave or David_Sherman%Wayne-MTS%UMich-MTS.Mailnet@MIT-Multics.ARPA