From mboxrd@z Thu Jan 1 00:00:00 1970 From: erik quanstrom Date: Mon, 14 Dec 2009 11:14:32 -0500 To: 9fans@9fans.net Message-ID: In-Reply-To: <8e04b5820912140715g20e56d31m57bd7e567843d0e4@mail.gmail.com> References: <0d3820e90fedfa15c374652fe64f06b4@ladd.quanstro.net> <8e04b5820912140715g20e56d31m57bd7e567843d0e4@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: Re: [9fans] rc shell UNIX port repository Topicbox-Message-UUID: b01d9122-ead5-11e9-9d60-3106f5b1d025 > One for example (I think it is a bug, but maybe in the semantics > you've described it's not): > * again if we're using `-e`, and inside a function we write `fn > dosomething { echo 1 ; false ; echo 2 ; return 0 ; }` > * if we run `dosomething` it shall output only `1`, as the false > breaks the execution; > * but if we run `dosomething || echo 3`, we see `1 2` outputed, > because the false is not exiting the shell as the invocation of the > function is part of a `||` statement; not a bug. x || y is "line" in the rc grammar. "x;" is als o a line. -e is only evaluated at the end of lines. > But undoubtedly, the following is a bug (I have an array and want > to display all the elements on a single line, wrapped inside quotes, > and everything with a prefix and a suffix): [...] > ifs='\n' echo ' erl files = ('^`{ echo -n > '`'^$application__erl_files__short^'`' }^')' > ifs='\n' echo ' erl files = ('^`{ echo -n > '`'^$application__erl_files__long^'`' }^')' > ~~~~ > it displays: > ~~~~ > erl files = (`a.erl` `b.erl` `c.erl`) > erl files = (`/home/cipria) erl files = (/workbe) erl files = > (ch/vel/a.erl` `/home/cipria) erl files = (/workbe) erl files = > (ch/vel/b.erl` `/home/cipria) erl files = (/workbe) erl files = > (ch/vel/c.erl`) > ~~~~ not a bug. you set the ifs to '\' and 'n'. since the first list doesn't have any ns in it, it doesn't get split. to get a newline in rc you need ifs=' ' cmd - erik