Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

bash string starts with

[[ $a == z* ]]   # True if $a starts with a "z" (wildcard matching).
[[ $a == "z*" ]] # True if $a is equal to z* (literal matching).

if [[ "$HOST" =~ ^user.* ]]; then
    echo "yes"
fi

if [[ "$HOST" =~ ^user.*|^host1 ]]; then
    echo "yes"
fi
Comment

PREVIOUS NEXT
Code Example
Shell :: delete directory rpi 
Shell :: how to undo a modified file in git 
Shell :: commit with empty message 
Shell :: undo git merge 
Shell :: linux zip a folder without compression 
Shell :: run bash script in its directory 
Shell :: this error may indicate that the docker daemon is not running 
Shell :: Authentication is required to create a color managed device 
Shell :: grub customizer install 
Shell :: systemd version check 
Shell :: git prune remote branches 
Shell :: bash run inline command 
Shell :: convert github issur into pr 
Shell :: ufw add rule 
Shell :: bash remove all files in directory except a few 
Shell :: how to download from git branch 
Shell :: ubuntu 20.10 how to open zip file 
Shell :: firebase deploy command 
Shell :: how to use multiple commands in linux 
Shell :: install wp-cli 
Shell :: kill port ubuntu 
Shell :: update local repository from github 
Shell :: docker starting forever 
Shell :: force delete a branch in git 
Shell :: aircrack-ng rtl8812au 
Shell :: get ram of ubuntu 
Shell :: cannot delete /var/lib/php/sessions/ 
Shell :: remove staged files git 
Shell :: E: Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable) 
Shell :: git tls certificate verification has been disabled 
ADD CONTENT
Topic
Content
Source link
Name
9+7 =