From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 Date: Fri, 5 Jun 2009 21:58:26 +0200 Message-ID: From: Rudolf Sykora To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: [9fans] simple question: multiple rename Topicbox-Message-UUID: 054efdf8-ead5-11e9-9d60-3106f5b1d025 Hello, I realized I cannot come up with a simple solution for the following. I want to rename all the files whose names end with _g_b to just _g, e.g. hello_g_b should be renamed to hello_g. I simply don't know an easy way. [the opposite way is simple: for(i in *_g) mv $i $i^_b ] I only think about so complicated ways like for(i in *_g_b) { s = `{sam -d <[2] /dev/null 1s/(.+)_g/\1 p EOF } mv $i $s } which describes my idea, but doesn't work, actually. (btw. how can one correct it?) Thanks Ruda