echo "hello123" | tr -dc '[0-9]' | wc -c
using this command i can count the no of times a number from 0-9 occurs in the string "hello123"
but how do i save this result inside a variable?
if i do
x= echo "hello123" | tr -dc '[0-9]' | wc -c
that does not work...plz suggest..thanks