Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

substring in shell script

STR="birthday-091216-pics"
SUBSTR=$(echo $STR | cut -d'-' -f 2)
echo $SUBSTR
Comment

how to print substring in bash script

INPUT='someletters_12345_moreleters.ext'
SUBSTRING=$(echo $INPUT| cut -d'_' -f 2)
echo $SUBSTRING
Comment

PREVIOUS NEXT
Code Example
Shell :: pip3 to pip 
Shell :: check android studio path linux 
Shell :: How to remove local (untracked) files from the current Git working tree 
Shell :: ubuntu 20.04 wont see OpemSSH 
Shell :: grafana docker 
Shell :: git push in a new branch 
Shell :: how to delete file from git command 
Shell :: install latest angular cli 
Shell :: bash store contents of file in array 
Shell :: linux mount nfs share 
Shell :: Large files detected. You may want to try Git Large File Storage 
Shell :: install discord on fedora 
Shell :: install go 
Shell :: how to change permissions for only the root 
Shell :: database is being accessed by other users 
Shell :: create a junction in windows 
Shell :: run mongodb on desktop 
Shell :: find tomcat location in mac 
Shell :: linux how to free memory 
Shell :: linux back cd 
Shell :: installing pytorch 
Shell :: generating javadoc 
Shell :: how to install jupyter in excel 
Shell :: testing cors 
Shell :: install cuda driver in ubuntu 
Shell :: valet allow phpmyadmin route 
Shell :: git language 
Shell :: git remove all pdf files 
Shell :: linux create executable 
Shell :: how to list all versions of pip in ubuntu using grep 
ADD CONTENT
Topic
Content
Source link
Name
6+7 =