From mboxrd@z Thu Jan 1 00:00:00 1970 From: erik quanstrom Date: Fri, 12 Apr 2013 08:56:21 -0400 To: 9fans@9fans.net Message-ID: <56802e952dbdab2949ef6e4fae793332@kw.quanstro.net> In-Reply-To: <20130412122153.GA16785@one.invalid.invalid> References: <20130410220136.GA22815@one.invalid.invalid> <20130412122153.GA16785@one.invalid.invalid> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: Re: [9fans] International Ispell in Plan9 Topicbox-Message-UUID: 40fe3190-ead8-11e9-9d60-3106f5b1d025 > { > echo noscroll > if(~ $#args 0){ > cat > /tmp/$pid^'.'aispell0; i = /tmp/$pid^'.'aispell0; winname = `{cat /mnt/acme/$winid/tag | awk '{print $1}'}; for(j in `{cat $i | $home/local/bin/ispell -a $spellflags | awk '/^[&#]/{gsub(/ /,"_"); print}'}){$home/local/bin/acme/spout $i | grep `{echo $j | awk -F_ '{print $2}'} | awk -F: '{OFS=":";$1 = "'$winname'"; print}' >> /tmp/$pid^'.'aispell } ; sort -u /tmp/$pid^'.'aispell > $dir/$id/body; rm -f /tmp/$pid^'.'aispell* > } > if not for(i in $args){ > for(j in `{cat $i | $home/local/bin/ispell -a $spellflags | awk '/^[&#]/{gsub(/ /,"_"); print}'}){$home/local/bin/acme/spout $i | grep `{echo $j | awk -F_ '{print $2}'} >> /tmp/$pid^'.'aispell } ; sort -u /tmp/$pid^'.'aispell > $dir/$id/body; rm -f /tmp/$pid^'.'aispell > } > echo clean > }> $dir/$id/ctl the rest of the script is nicely formatted. but it looks like this bit could use some formatting. remember, you get a free newline after { and |. there is some opportunity to simplify, too. for example cat /mnt/acme/$winid/tag | awk '{print $1}' is more simply sed 's/ .*//g' < /mnt/acme/$winid/tag i see several places one could replace awk with sed and cat with redirection. and i think further simplification is possible by using {} instead of the temporary file dance. and i'd imagine that that's where the bug is. - erik