From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 Date: Fri, 11 Jan 2013 12:19:06 +0100 Message-ID: From: "Peter A. Cejchan" To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: text/plain; charset=UTF-8 Subject: [9fans] How to do this with [acme | sam | sed ] ? Topicbox-Message-UUID: 05b84292-ead8-11e9-9d60-3106f5b1d025 ## How to do this with [acme | sam | sed ] ? # compound commands # remove outermost pair of braces: abcd(x+(y-z))efgh --> abcdx+(y-z)efgh [ no idea :-( ] # remove semicolon before // comments: xyz;[tab][space]*// --> xyz [ Edit /;[ ]*\/\// Edit s/;// # find and remove semicolon before // comments ] # prefix to postfix operator: ++i --> i++ [ Edit s/\+\+[a-zA-Z]+[0-9a-zA-Z]*/&++/ Edit s/\+\+/d] thanks, ++pac