Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

how to check whether a string contains a special character or not in bash

if [[ $str =~ ['!@#$%^&*()_+'] ]]; then
    echo yes
else
    echo no
fi
Comment

PREVIOUS NEXT
Code Example
Shell :: truncate log file linux 
Shell :: rsync backup 
Shell :: gitignore files that are already tracked 
Shell :: how to create a folder in linux 
Shell :: how to run a .sh file 
Shell :: manjaro linux system information 
Shell :: remove file via command line 
Shell :: name stash 
Shell :: Git - fetch changes from remote repo for current branch 
Shell :: check linux disk ussed in wsl wwindow 
Shell :: git diff between two repos 
Shell :: enter a stopped docker container 
Shell :: ppsspp debian 10 
Shell :: grafana speedtest 
Shell :: kibana download 
Shell :: sudo pip3 install 
Shell :: unzip gz file linux 
Shell :: Command to create a new Vue app 
Shell :: install mongodb debian 10 
Shell :: git push without password 
Shell :: add remote github 
Shell :: ssh list port forwards 
Shell :: docker image is not reseting 
Shell :: add co author git 
Shell :: update node manjaro 
Shell :: delete a folder then git push 
Shell :: how to add code to git 
Shell :: sed replace with newline 
Shell :: dns_probe_finished_nxdomain ubuntu 
Shell :: git flow feature 
ADD CONTENT
Topic
Content
Source link
Name
6+2 =