I use the command really often:
ack searchexpre -l --print0 | xargs -0 -n 1 sed -i -e sedexpression
I would like to create an alias like:
searchandreplace searchexpre sedexpression
How I can do that?
I use the command really often:
ack searchexpre -l --print0 | xargs -0 -n 1 sed -i -e sedexpression
I would like to create an alias like:
searchandreplace searchexpre sedexpression
How I can do that?
The rule of thumb with aliases is that if you have to ask, you should be using a function instead:
searchandreplace() {
ack "$1" -l --print0 | xargs -0 -n 1 sed -i -e "$2"
}
You can now call searchandreplace searchexpre sedexpression