smart channel --show doesn't return proper code

Gustavo Niemeyer gustavo at niemeyer.net
Wed May 9 15:52:22 PDT 2007


Hi Grant,

> When I do smart channel --show <channelname> and the channel doesn't
> exist shouldn't smart return a 1 instead of a 0? It seems to be
> returning 0's for everything.
> 
> I have  a script that checks to see if a channel has already been
> added and if not adds it. We're having to take the output of channel
> --show and grep it instead of relying on the return code. Am I off on
> this or maybe not understanding why smart channel --show always
> returns a 0 return code?

Yep, you're right.  Many commands are not quite scripting-ready yet.

Did you consider using Python to perform that?  Should be quite
simple to use Smart as a library.

-- 
Gustavo Niemeyer
http://niemeyer.net



More information about the Smart mailing list