Hi, I'm fairly new to Linux, and trying to do some rudimentary bash scripting. Here's my problem, I'm writing a really simple bash script to run the mp3 encoder Lame with my normal command-line arguments (more as an experiment than a real necessity), and am having problems with I'm passing it command-line parameters with spaces involved. For instance, this command executed in a shell works just fine, where hde1 is my other hd still in Fat32 with windows installed as a dual-boot (barely used now),
lame --preset standard "/mnt/hde1/windows/desktop/from other hd/to encode.wav"
but this simple bash script does not work, when I execute it as
./lamescript "/mnt/hde1/windows/desktop/from other hd/to encode.wav"
Code:
#!/bin/bash
#runs the --preset standard lame, outputs to input.mp3
lame --preset standard \"$1\"
echo "Finished executing Lame encoder..."
exit
...it gives an error because it interprets all the text after a space as another command line argument.
What confuses me though, is that if I echo the same command, everything looks to be formated exactly as it is when I type it directly into the shell, which works.
Any ideas??
~Andrew