From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 Date: Wed, 21 Mar 2012 10:26:27 +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] removing spaces from filenames Topicbox-Message-UUID: 6cae03c0-ead7-11e9-9d60-3106f5b1d025 # remove spaces from file names /// does not work EXT=boo rm run for (old in `{9 ls *.$EXT}) { new=`{echo $old | tr -d ' ' } echo mv $old $new >> run } # this works, but is ugly: # remove unwanted chars from file names EXT=boo 9 ls *.$EXT > foo 9 cat foo | 9 tr -c [0-9][a-z][A-Z]'.''\x0a' '_' | 9 tr -s '_' '_' | 9 sed 's/_\././g' > foo2 paste foo foo2 > foo3 9 awk '{print "mv ", $0}' foo3 > run what am I missing? Thanks, ++pac