Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

filter match in line sed

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 :: install docker in suse linux 
Shell :: powershell show first few lines of command 
Shell :: bash function parameter 
Shell :: how to edit and save crontab in linux 
Shell :: cli50 installation 
Shell :: knows the version of one application on ubuntu 
Shell :: remove yum package with its dependencies 
Shell :: install apk as system app with adb 
Shell :: Update CA Certificate Linux 
Shell :: vmware not working after ubuntu upgrade 
Shell :: kubectl patch annotation 
Shell :: check app installed with brew 
Shell :: bitnami wordpress enable ssh 
Shell :: linux get part of string 
Shell :: git use stash on another computer 
Shell :: how to clear a file without deleting it linux 
Shell :: git commit with message 
Shell :: bash echo each line 
Shell :: ncrack ftp brute force 
Shell :: how to scp from vm to local 
Shell :: poetry reinstall venv 
Shell :: run url in pip 
Shell :: mount a folder from windows inside wsl 
Shell :: npm commands 
Shell :: How to download torrents from the command-line on Linux 
Shell :: make new branch in git 
Shell :: install moment.js 
Shell :: setup ssh key 
Shell :: Rename Files in git command 
Shell :: git diff ignore file 
ADD CONTENT
Topic
Content
Source link
Name
8+5 =