0

I'm using this alias to color my cat results. However, I want to add line numbers to the output, but using ccat -n <filename> is not working.

I can achieve it by ccat <filename> | cat -n but I can't create an alias for that (I expect an alias such as ccatn which I could use like ccatn <filename>)

What can I do to get this functionality (meaning, type in a command and a file name and get the same result as typing ccat <filename> | cat -n)?

CIsForCookies
  • 12,097
  • 11
  • 59
  • 124

1 Answers1

1

Use a function instead:

ccatn() {
    pygmentize -g -O style=colorful,linenos=1 "$1" | cat -n
}
mhhollomon
  • 965
  • 7
  • 15