Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

sed add newline

For substituting with newline use sed command to replace a match with a
not used char and tr command to replace that char with a newline '
'
#For example:
echo "123." | sed -E 's/([[:digit:]]*)./1|next line/' | tr '|' '
'
Comment

sed add lines

#add some lines from a file to 78 line of my file
sed -i -e '78r../../insert_file' File_you_change.txt 
#-i update the file , 
Comment

sed add new lines using a pattern

sed -i -e 's/yourpattern/yourpatternXXXTTTXXX/g' -i -e 's/XXXTTTXXX/
/g' file
									^add some unique pattern here
                                 # -i update the file , try without -i   
Comment

PREVIOUS NEXT
Code Example
Shell :: linode aapanel info location 
Shell :: cmd if compare more than 
Shell :: nc + bash 
Shell :: powershell get-aduser global catalog 
Shell :: git switch to specific branch name 
Shell :: Git - graph all commits for repot in terminal and show commit messages one line 
Shell :: error: failed to init transaction 
Shell :: global menu cinnamon 
Shell :: Hide docker legacy commands 
Shell :: install openzeppelin dependencies for hardhat enviroment 
Shell :: Install the package to configure and build kernel 
Shell :: upgrade r from consele 
Shell :: lightsail get plesk password 
Shell :: best ubuntu torrent downloader 
Shell :: start spark-shell with more heap space 
Shell :: ctrl+z equivalent in vim 
Shell :: cd to a sub-directory 
Shell :: docker: Cannot connect to the Docker daemon at tcp://localhost:2375. Is the docker daemon running? 
Shell :: Git global setupCreate a new repository 
Shell :: ring check if the operating system is Linux or not 
Shell :: EFS mounting on EC2 Instances 
Shell :: powershell show doskey 
Shell :: run alpine container continuously 
Shell :: ghost in the shell stand alone complex book quotes 
Shell :: pip install PyPortfolioOpt 
Shell :: Transfer all the changes made to a single file between git branches 
Shell :: what is --save-dev check when we install a pachage 
Shell :: github.com:Torono909/Torono909.git 
Shell :: batch copy and replace code 
Shell :: can you upgrade processort without reinstalling proxmox 
ADD CONTENT
Topic
Content
Source link
Name
8+2 =