How do I the extract the first digit from a number (variable in a bash script)? – unix.stackexchange.com

Let's say the variable numbers=$@ where $@is from user input. The user typed in ./script.sh 901.32.02 and I want to get the first digit 9 and store in another variable. How can I do this? I was told ...

from Hot Questions - Stack Exchange OnStackOverflow
via Blogspot

Share this

0 Comment to "How do I the extract the first digit from a number (variable in a bash script)? – unix.stackexchange.com"