in reply to Easy Things
Other responses have latched on to perl -e and that's probably one good avenue to explore. Here's a real-world example for you. I recently downloaded a bunch of files from a Windows system and uploaded them to a FreeBSD system, only to find that the spaces in the file names had been encoded so they were now '%20'. I had to rename three directories, each containing six files.
After wimping out on the first two directories (this was time critical stuff and it was after midnight, a great time for making dumb mistakes, especially after a jam-packed 11 hour work day) I wrote
That seemed OK, but then I realized I'd have to escape the space in the middle of the name, so finally I wroteperl -e 'while(<*.mp3>){$orig=$_;s/%20/ /;print"$orig -> $_\n";}'
I ran it, and the verbose option confirmed that I'd done it correctly.perl -e 'while(<*.mp3>){$orig=$_;s/%20/\\ /;print`mv -v $orig $_`;}'
So what did that require that I wouldn't have had a clue how to do as a beginner?
Alex / talexb / Toronto
Life is short: get busy!
|
|---|