LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   want to get the integer value count (http://www.linuxquestions.org/questions/linux-newbie-8/want-to-get-the-integer-value-count-559531/)

Volcano 06-06-2007 02:39 AM

want to get the integer value count
 
Input :

WC -l xyz.xml

output:

5000 xyz.xml




i dont want this output ...i need only 5000 .

How do i format my input command so that i can get output only 5000 ?

i just want to get the integer value count ..

druuna 06-06-2007 03:13 AM

Hi,

This is one way:

wc -l | awk '{ print $1 }'

Hope this helps.

ghostdog74 06-06-2007 03:40 AM

with bash
Code:

# set -- $(wc -l xyz.xml)
# echo $1


Volcano 06-06-2007 04:12 AM

Quote:

Originally Posted by druuna
Hi,

This is one way:

wc -l | awk '{ print $1 }'

Hope this helps.


confused ....where is the xyz.xml ?

druuna 06-06-2007 05:19 AM

Hi,

Oops......

wc -l xyz.xml | awk '{ print $1 }'

Sorry about that!


All times are GMT -5. The time now is 08:10 PM.