Re: Bash function not working…

Johnny Rosenberg gurus.knugum at gmail.com
Tue Jan 8 17:19:51 UTC 2013


I don't really know what I'm doing here, as it seems. I sent yet
another mail privately, not to the list. Sorry for that once again, I
should go hang myself I guess, but instead I just send this copy to
the list. I'll tripple check the address field. Yes, it looks right
this time. I'll check again… yes, still right. I'll hit the send
button now…

2013/1/8 Johnny Rosenberg <gurus.knugum at gmail.com>:
> 2013/1/8 Paul Smith <paul at mad-scientist.net>:
>> 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?
>>
>
> For some reason, I don't really understand why, it seems like I read
> all the replies except that one. Strange since that was the very first
> reply that I got. However, when I first noticed someone replied, I
> think there was 3 or 4 replies already. I probably went through them
> too fast so I missed the important one. Terribly sorry for that.
> Entirely my mistake. And of course you were right, it was totally that
> beginner's mistake that I made so many times before. Some day I'll
> learn, I hope…
>
> Thanks again for all the replies.
>
>
> Johnny Rosenberg




More information about the ubuntu-users mailing list