I like weird characters in mp3 file names, because I want the file names to contain the exact titles.

Often it's not difficult to use the command line in a way that there's no problem with special characters. For instance, rather than writing Perl code like

`mv "$url" "$title"`
you can use
system('mv', $url, $title)
or on GNU:
system('mv', '--', $url, $title)
or even
rename($url, $title)

This will work perfectly with all kinds of strange characters in file names. Plus, it's more secure.

Another problem some people face is shell stuff like this:

for i in `ls`; do some_command $i done

Of course, this will not work if there are file names with spaces (or globs).

However, this will work fine:

for i in *; do some_command "$i" done

In reply to Re: small script to make mp3 filenames more command line friendly by betterworld
in thread small script to make mp3 filenames more command line friendly by jonsmith1982

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.