[TriLUG] scripting question

Chris Merrill chris at webperformance.com
Tue Mar 15 16:13:19 EDT 2011


The FLAC>MP3 converter script I posted about earlier has one annoying little
behavior.  It spews a lot of crap to the screen.  I am somewhat confident it
comes from this line:

if ! lame --genre-list | grep "${command[$((i+1))]}" >/dev/null; then
	command[$((i+1))]=""
	[ "$verbose" ] && echo "Nullified the genre tag as the specified genre does not exist."
fi

where command[$((i+1))] is some parameter it is looking for in the output from
the "lame --genre-list" command.

I think the output from "lame --genrelist" was supposed be grepped and all
output piped to null, but it is appearing on the console anyway.

Can anyone suggest a modification to the above code that would keep the output
from reaching the console (except the echo, of course) ?   I should probably
dig up some bash scripting references figure this out myself...but I'm supposed
to be working right now   ;)




-- 
------------------------------------------------------------------------ -
Chris Merrill                           |  Web Performance, Inc.
chris at webperformance.com                |  http://webperformance.com
919-433-1762                            |  919-845-7601

Web Performance: Website Load Testing Software & Services
------------------------------------------------------------------------ -



More information about the TriLUG mailing list