[TriLUG] scripting question
Jon Carnes
jonc at nc.rr.com
Tue Mar 15 17:07:59 EDT 2011
Put a "2" in front of the ">" to indicate that you want console output
redirected to /dev/null
On Tue, 2011-03-15 at 16:13 -0400, Chris Merrill wrote:
> 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
> ------------------------------------------------------------------------ -
--
---
"Be yourself... unless you suck."
Josh Whedon
More information about the TriLUG
mailing list