All pastes #276961 Raw Edit

Untitled

public text v1 · immutable
·published 2006-12-12 20:35 UTC
rendered paste body
# For each file, change all characters not in [] below to '_'
# and move to ~/doc.
# I'm running this from the command line, not from a script.

# Error message I get:
# mv: target `/home/bytecolor/doc/file_name_with_underscores.pdf' is not a directory

$ for f in *; do
$ mv $f ~/doc/`echo $f | tr -cs '[A-Za-z0-9_.\n]' _`
$ done