Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

grep only number from line

$ NUMBER=$(echo "I am 999 years old." | grep -o -E '[0-9]+')
$ echo $NUMBER
999
 
PREVIOUS NEXT
Tagged: #grep #number #line
ADD COMMENT
Topic
Name
6+5 =