Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

bash command substitution

# Basic syntax:
$(command)

# Example usage:
for file in $(ls)
do
  echo $file
done
--> # all files in your current directory are echoed
Comment

bash variable substitution

${!var}	#Just use to use reference value inside another variable ;)
Comment

bash substitution

## Bash Substitution - Search/Replace
${var#Pattern}
# Remove the shortest part of $Pattern that matches the front end of $var.
${var##Pattern} 
# Remove the longest part of $Pattern that matches the front end of $var.

${var%Pattern} 
# Remove the shortest part of $Pattern that matches the back end of $var
${var%%Pattern}
# Remove the longest part of $Pattern that matches the back end of $var

${var/Pattern/Replacement}
# Replace First match of Pattern
# If Replacement is omitted, the first match is replaced by nothing

${var//Pattern/Replacement}
# Global replacement. Replace All matches of Pattern
# if Replacement omitted, all occurrences of Pattern are replaced by nothing
Comment

PREVIOUS NEXT
Code Example
Shell :: create a branch from old commit 
:: install redux 
Shell :: ssh sever time out 
Shell :: modifier un nom de branche git 
::  
:: how to remove file from directory in linux 
Shell :: configure a subdomain apache windows 
:: git revert to last commit on remote branch 
Shell ::  
:: rescale kubectl 
::  
::  
Shell :: copy paste file terminal 
Shell :: diff linux 
::  
:: list directories linux 
::  
:: git go to commit id 
Shell ::  
Shell ::  
Shell ::  
::  
Shell ::  
Shell ::  
Shell :: git push to new branch 
Shell ::  
Shell ::  
Shell :: how to uninstall a package in react 
:: How to add a shell script to launcher 
Shell :: mac Os dark icons for ubuntu 20.04 
ADD CONTENT
Topic
Content
Source link
Name
2+1 =