0

I am trying to make a bash alias to grep for Git conflicts within files after a merge occurs. Usually on the command line with bash shell, I run grep -nr '<<<<<<<', where the single-quotes are needed to escape the special characters.

My ~/.bashrc file has this so far:

alias confs="grep -nr \'<<<<<<<\'"

However, the output when runing confs command is

bash: syntax error near unexpected token `<<<'.

How do I do this? Thanks

1
  • 1
    Welcome, Does not alias confs="grep -nr '<<<<<<<'" accomplish what you want? ` Jan 15, 2021 at 2:17

1 Answer 1

1

The solution was very simple thanks to schrodigerscatcuriosity. The way to do this would be: alias confs="grep -nr '<<<<<<<'". No extra escape characters are needed

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.