greenh='\e[2;30;42m$&\e[0m/g'
yellowh='\e[2;30;43m$&\e[0m/g'
aquah='\e[2;30;46m$&\e[0m/g'
function recolor() {
perl -pe "s/$1/$2"
}
i use this to recolor text
EXAMPLE:
cat file.txt | recolor WHATEVERWORD $greenh
Is there a way that i can include the $ in the function so i can use it like
cat file.txt | recolor WHATEVERWORD greenh
I tried
function recolor() {
perl -pe "s/$1/$$2"
}
function recolor() {
perl -pe "s/$1/\$$2"
}
Both of them just break the function altogether...