Kenny Donahue said:
>Ok, here's one for all you bash experts out there.
>I have a line in a script that does this:
>
>lspci -d1134:1 | /usr/bin/wc -l
>
>The idea of course is to get the number of our boards in the
>system.  the funny thing is, if I log in as root I get
>      2    /* Note the 6 blank spaces before the "2" */
>
>if I log in as my self or ssh into the machine and su to root, I get
>2 /* note NO space before the "2" */
>
>if I ssh into the machine and "sh - " to root I get
>      2    /* Note the 6 blank spaces before the "2" */
>again.  What's up.


1st, try:

lspci -d1134:1 | /usr/bin/wc -l | tr -d ' '


that'll eliminate the space & let you continue w/ your problem.

As for the different behaviour of wc's output, I'll leave that to 
others.  But I suspect when you do it as root or sh - you get root's 
environment instead of your own and there's some difference between the 
two.  If you do the tr thing, it really doesn't matter :-)


>I did clean up the spaces with sed so this is not a functional problem.
>
>
>TIA,
>Kenny
>
>
>--
>Ken Donahue
>Software Engineer
>phone: 978 967-1820
>email: [EMAIL PROTECTED]
>Mercury Computers, Inc.
>System OS - Host Development Team
>
>
>
>
>*****************************************************************
>To unsubscribe from this list, send mail to [EMAIL PROTECTED]
>with the text 'unsubscribe gnhlug' in the message body.
>*****************************************************************
>

-- 
-------
Tom Buskey



*****************************************************************
To unsubscribe from this list, send mail to [EMAIL PROTECTED]
with the text 'unsubscribe gnhlug' in the message body.
*****************************************************************

Reply via email to