Bash function not working…

Paul Smith paul at mad-scientist.net
Tue Jan 8 17:08:30 UTC 2013


On Tue, 2013-01-08 at 17:57 +0100, Johnny Rosenberg wrote:
> Thanks for all replies. As many pointed out, replacing , with ","
> didn't change anything. I will do some more tests to see if I can
> figure out which pipe mess things up.
> In the mean time, more replies are welcome, of course…

I told you what was wrong in my first reply:

> On Tue, 2013-01-08 at 16:38 +0100, Johnny Rosenberg wrote:
> > speltid () {
> > ffmpeg -i $1 2>&1 | \
> 
> First rule of shell scripting (suitable for framing):
> 
> ALWAYS QUOTE EVERY VARIABLE REFERENCE!
> 
> [...]
> 
> Change your function to use "$1" instead of just $1 and you'll have
> better luck.
> 
> Cheers!

By this I mean the $1 in my quote above (the one to ffmpeg).  The one to
awk is already quoted in '', which is correct.

Did this not fix the problem?





More information about the ubuntu-users mailing list