Check

Print Friendly

By SkySmart

Code:

echo "2012-12-26--14.8224 2012-12-27--14.2898 2012-12-28--14.9180 2012-12-29--13.3637 2012-12-30--13.7091"


the set of numbers i provided above is separated by spaces. how do i count how many sets there are?

i tried:

Code:

echo "2012-12-26--14.8224 2012-12-27--14.2898 2012-12-28--14.9180 2012-12-29--13.3637 2012-12-30--13.7091" | wc -w


———- Post updated at 10:57 AM ———- Previous update was at 10:56 AM ———-

actually never mind, i think i may have found the solution:

Code:

echo ""2012-12-26--14.8224 2012-12-27--14.2898 2012-12-28--14.9180 2012-12-29--13.3637 2012-12-30--13.7091"" | wc -w


notice the double quotes.

Source: FULL ARTICLE at The UNIX and Linux Forums

FavoriteLoadingAdd to favorites

Leave a Reply

Your email address will not be published. Required fields are marked *