From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: From: erik quanstrom Date: Sun, 10 Feb 2008 12:47:56 -0500 To: 9fans@cse.psu.edu Subject: Re: [9fans] How to move to rc from sh/bash In-Reply-To: <41F23396-1019-4C8E-A65A-E42824B0E23B@mac.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Topicbox-Message-UUID: 4ec774f8-ead3-11e9-9d60-3106f5b1d025 > It produces the string ' bla$e''o' in rc syntax. The one thing I like > about two quoting styles in the Bourne shell is that I can use it's not so much the number of quotes (there are three, by the way), it's the complex rules. for example: ; /bin/bash $ x=1 $ echo "$x" 1 $ echo '$x' $x $ echo `echo "\$x"` 1 <- reparsing rule. $ echo "'$x'" '1' $ echo "'\$x'" '$x' but $ echo `echo > The proper is > > if [ $bla -eq $otherbla ]; then > : > fi > > The advantage of rc is that that : is not necessary! > > Oh, and let's not forget what happens when bla or otherbla is nil! In > rc, > if (~ $bla $otherbla) { } > is all that is needed - no hooks. that's actually a problem. while ~ is nice, it only does shell matching. what if you want regexp matching or test (aka on unix [) operators? then you have exactly the same problem with missing variables. > And what I dislike: > - >[2=] is not the same as >[2]/dev/null (some programs crash with > the former this isn't a shell issue. >[2=] closes fd 2. it's not clear to me that arbitrary plan 9 programs are expected to run without one of the three fds they've been promised by convention. - erik