Oooops, you forgot to post your code.
1) How would I go about escaping specific chars and spaces with a \ ?
Generally with single quotes, rather than character-specific escaping with \. 'this is a single filename'. But that's in the shell, not in Perl... so in Perl you might want single quotes inside your Perl level quotes, something like:
</code>
system( "/usr/bin/myfavcoverter -flag 'my filename with lame spaces' '$my_scalar_that_holds_a_evil_file_with_funny_characters'" );
</code>
Note that it's actually better to split up the arguments to system(), so that it doesn't have to use the shell... please see the documentation for system() for details.
please don't do like I did there and use a scalar that was set from outside the file, like a filename or user input, until you've read and understand all of the perlsec man page( perldoc perlsec ). Otherwise, you'll be creating a security hole. But for converting media files, it's probably not really an issue, unless you're going to allow others to use it. For example, placing it in /usr/bin on a system with other users...
2) Which characters in a UNIX file name must be escaped?
That depends on which shell you're using. /bin/sh is usually bash, so "man bash" will help there. Or, just put it all in single quotes to cheat until you learn the details... ;)
3) And finally, after everything is coded and functioning, how would I go about making it excuteable from /usr/bin (or wherever) so that i can just call the name of the program and have it run?
assuming the first line of your Perl program is #!/usr/bin/perl then you'll only need to do chmod a+x myperlscript
update: I use the program xcdroast for all my linux cd burning joys. You might want to also look at gtoaster.
-- Snazzy tagline here
|