9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] removing spaces from filenames
@ 2012-03-21  9:26 Peter A. Cejchan
  2012-03-21 13:20 ` yy
       [not found] ` <CADErNDsJhiaoDRdfvmyZLtTwrsXVqK1V1CQzC5SwPGdS+HbsYg@mail.gmail.c>
  0 siblings, 2 replies; 4+ messages in thread
From: Peter A. Cejchan @ 2012-03-21  9:26 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

# 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



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-03-22  7:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-21  9:26 [9fans] removing spaces from filenames Peter A. Cejchan
2012-03-21 13:20 ` yy
     [not found] ` <CADErNDsJhiaoDRdfvmyZLtTwrsXVqK1V1CQzC5SwPGdS+HbsYg@mail.gmail.c>
2012-03-21 16:36   ` erik quanstrom
2012-03-22  7:05     ` Peter A. Cejchan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).