Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

bash get first number from string

#credit to the Stack Overflow user in the source link
echo $string1 | sed 's@^[^0-9]*([0-9]+).*@1@'
Comment

PREVIOUS NEXT
Code Example
Shell :: python rioxarray install 
Shell :: commit history 
Shell :: git pull pr 
Shell :: gitlab clone branch 
Shell :: remove xcode archives 
Shell :: windows unable to format protected usb 
Shell :: install foxit pdf reader on ubuntu 20.04 
Shell :: install Helm v3.x 
Shell :: libodbc1 2.3.7 ubuntu 
Shell :: ./utserver: error while loading shared libraries: libssl.so.1.0.0: cannot open shared object file: No such file or directory 
Shell :: how to setup promethus on docker 
Shell :: how to open a iso file in linux 
Shell :: is there any method to do clearscreen mongo shell 
Shell :: bash float 
Shell :: linux while loop shell 
Shell :: mac theme ubuntu terminal 
Shell :: check last 5 commit git on branch 
Shell :: pacman arch 
Shell :: regex to accept at most two digit :js 
Shell :: gnome terminator 
Shell :: how to install software in linux terminal 
Shell :: how to get the vimrc path 
Shell :: powershell add line to text file 
Shell :: how to remove first colum froim file linux 
Shell :: read input from multiple lines in BASH 
Shell :: shell/bash 
Shell :: show output after a keyword in shell script in a file 
Shell :: sed replace 
Shell :: how to make apache not run automatically linux 
Shell :: linux command to show memory hardware 
ADD CONTENT
Topic
Content
Source link
Name
3+3 =