I assume it's because of the preceeding whitespaces from wc, unfortunately the 
error channel from the script is discarded so I'm only 99.98% sure ;) (imho 
stderr should be echoed back to the console).

~ > chio -f /dev/ch0 status slot|wc -l
       6
~ > chio -f /dev/ch0 status slot|wc -l|bc
6
~ > 

Maybe someone else with a similar setup can check if this problem is 
reproducable? (FreeBSD 5.4-STABLE and FreeBSD 6.0-STABLE, do "update slots" for 
a check). At least here it's definitely not working without the the '|bc' but 
working with it. 
On the other hand I don't think the additional "bc" will break anything (at 
least) in the *BSD world (which is where chio is used) since "bc" is part of 
base. I guess a line in the release notes is due anyway.
Kind regards,
Alex

> -----Original Message-----
> From: Kern Sibbald [mailto:[EMAIL PROTECTED]
> Sent: Monday, January 09, 2006 11:37 AM
> To: bacula-users@lists.sourceforge.net
> Cc: Alexander Kuehn; [EMAIL PROTECTED]
> Subject: Re: [Bacula-users] RE: [Bacula-devel] autochanger "update
> slots" bugfix
> 
> 
> Thanks for the output.
> 
> It is interesting to see how chio actually works.  However, I 
> don't understand 
> the need for a call to bc since "wc -l' at least on my system 
> returns a 
> perfectly valid count (in fact the same thing as "wc -l | bc".
> 
> On Monday 09 January 2006 10:55, Alexander Kuehn wrote:
> > Sure,
> > ~ > chio -f /dev/ch0 status slot
> > slot 0: <ACCESS,FULL>
> > slot 1: <ACCESS,FULL>
> > slot 2: <ACCESS,FULL>
> > slot 3: <ACCESS,FULL>
> > slot 4: <ACCESS,FULL>
> > slot 5: <ACCESS,FULL>
> > ~ > chio -f /dev/ch0 status slot|wc -l
> >        6
> > ~ >
> > Kind regards,
> > Alex.
> >
> > > -----Original Message-----
> > > From: Kern Sibbald [mailto:[EMAIL PROTECTED]
> > > Sent: Saturday, January 07, 2006 2:20 PM
> > > To: [EMAIL PROTECTED]
> > > Cc: Alexander Kuehn; bacula-users@lists.sourceforge.net
> > > Subject: Re: [Bacula-devel] autochanger "update slots" bugfix
> > >
> > >
> > > I've added your fix to the source, but in looking at the
> > > line, it seems to me
> > > that it is not going to handle things correctly.  Could you
> > > send me the raw
> > > output from:
> > >
> > >    ${MTX} -f $CHANGER status slot
> > >
> > > Thanks.
> > >
> > > On Thursday 05 January 2006 18:58, Alexander Kuehn wrote:
> > > > Hi,
> > > >
> > > > I just upgraded from bacula 1.36 to 1.38.2 and noticed that the
> > > > chio-changer script doesnt seem to work anymore. More
> > >
> > > specifically the
> > >
> > > > "update slots scan" command proclaimed I had 0 slots. It
> > >
> > > seems the output
> > >
> > > > of "wc -l" is not good enough for bacula anymore, so here
> > >
> > > is the patch for
> > >
> > > > examples/autochangers/chio-changer to fix the problem:
> > > >
> > > > --- chio-changer        Thu Jan  5 18:46:32 2006
> > > > +++ chio-changer.new    Thu Jan  5 18:45:47 2006
> > > > @@ -119,7 +119,7 @@
> > > >        ;;
> > > >
> > > >     slots)
> > > > -      ${MTX} -f $CHANGER status slot  | wc -l
> > > > +      ${MTX} -f $CHANGER status slot  | wc -l|bc
> > > >        ;;
> > > >  esac
> > > >
> > > >
> > > > Kind regards,
> > > > Alex.
> > > >
> > > >
> > > > -------------------------------------------------------
> > > > This SF.net email is sponsored by: Splunk Inc. Do you grep
> > >
> > > through log
> > >
> > > > files for problems?  Stop!  Download the new AJAX search
> > >
> > > engine that makes
> > >
> > > > searching your log files as easy as surfing the  web.
> > >
> > > DOWNLOAD SPLUNK!
> > >
> > > > http://ads.osdn.com/?ad_idv37&alloc_id865&opÌk
> > > > _______________________________________________
> > > > Bacula-devel mailing list
> > > > [EMAIL PROTECTED]
> > > > https://lists.sourceforge.net/lists/listinfo/bacula-devel
> > >
> > > --
> > > Best regards,
> > >
> > > Kern
> > >
> > >   (">
> > >   /\
> > >   V_V
> >
> > -------------------------------------------------------
> > This SF.net email is sponsored by: Splunk Inc. Do you grep 
> through log
> > files for problems?  Stop!  Download the new AJAX search 
> engine that makes
> > searching your log files as easy as surfing the  web.  
> DOWNLOAD SPLUNK!
> > http://ads.osdn.com/?ad_idv37&alloc_id865&opÌk
> > _______________________________________________
> > Bacula-users mailing list
> > Bacula-users@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/bacula-users
> 
> -- 
> Best regards,
> 
> Kern
> 
>   (">
>   /\
>   V_V
> 


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_idv37&alloc_id865&op=click
_______________________________________________
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users

Reply via email to