From: "Peter A. Cejchan" <tyapca7@gmail.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: [9fans] removing spaces from filenames
Date: Wed, 21 Mar 2012 10:26:27 +0100 [thread overview]
Message-ID: <CAM6ozu6EKxDage9itHJnZbDmRd94b_VpdS6jq9uw=8rdwsVpnQ@mail.gmail.com> (raw)
# 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
next reply other threads:[~2012-03-21 9:26 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-21 9:26 Peter A. Cejchan [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAM6ozu6EKxDage9itHJnZbDmRd94b_VpdS6jq9uw=8rdwsVpnQ@mail.gmail.com' \
--to=tyapca7@gmail.com \
--cc=9fans@9fans.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).