Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

sed repeat pattern

For using match in sed replacement, just border it with '(' and ')':
echo Before123 | sed 's/Before([0-9]*)/1After/g'
123After	# number is matched withtin '( )' and replaced in '1'
Example with 2 match replacements
echo a_b | sed 's/(^.*)_(.*$)/first is 1 and 2 is after/g'
Comment

PREVIOUS NEXT
Code Example
Shell :: rpi install kodi 
Shell :: find sort 
Shell :: git passphrase remember 
Shell :: crontab edit 
Shell :: how to install cli50 
Shell :: installing android studio on kali linux 
Shell :: delete list of packages linux 
Shell :: command to restart a system service 
Shell :: enale scp in ubuntu 
Shell :: TSC_DEADLINE disabled due to Errata; please update microcode to version: 0x22 
Shell :: set default terminal ubuntu 
Shell :: To set the exit status of a shell script 
Shell :: pig latin group by 
Shell :: how to prevent ubuntu sleeping when closing laptop 
Shell :: ansible playbook to set passwordless sudo 
Shell :: photoview github 
Shell :: kill process by name 
Shell :: how to boot from grub rescue 
Shell :: how to scan for raspberry pi on network windows 
Shell :: how to save ssh keygen How to add ssh keys to a specific user in linux? 
Shell :: install rabbitmq in ubuntu 20.04 
Shell :: laserjet m1132 mfp driver linux mint download 
Shell :: batch comment 
Shell :: powershell history file 
Shell :: curl trust self signed certificate 
Shell :: linux change directory 
Shell :: Amend The Most Recent Commit in git command 
Shell :: git issues 
Shell :: unzip a file terminal 
Shell :: vim get color name at cursor 
ADD CONTENT
Topic
Content
Source link
Name
7+8 =