Shell script ffmpeg
Hello,
I have converted my CD collection to .flac Now I would like to play my music on my ipod and a DSi, so I need to convert my files to .aac I have written this script Code:
!/bin/bash Code:
$ ./MusicConvert.sh Any advice is much appreciated. Dave |
You missed the 'do'
Also you probably want to use basename: Code:
!/bin/bash |
Thanks alot for your help. You can tell I don't write scripts often.
Have a great weekend! Dave |
A few more points.
1) The shabang starts with a "#!". http://mywiki.wooledge.org/BashGuide...uments#Scripts 2) Always quote variables, to avoid problems with word splitting. http://mywiki.wooledge.org/Arguments http://mywiki.wooledge.org/Quotes 3) Use globbing rules to ensure that you're grabbing only the files you want. For complex cases, use find. http://mywiki.wooledge.org/glob http://mywiki.wooledge.org/UsingFind 4) basename is unnecessary when you have parameter expansion. You may want to collect and use both the path and the filename, to make your script more flexible. http://mywiki.wooledge.org/BashFAQ/073 5) Consistent indentation and similar formatting, among other good practices, helps make scripts easier to read and debug. I think for/while/until loops are more readable when the "do" keyword is also on the same line, for example. http://mywiki.wooledge.org/BashGuide/Practices Code:
#!/bin/bash |
David the H, thanks for your help and the website. I will incorporate all into my next script.
R/ Dave |
All times are GMT -5. The time now is 05:41 AM. |