0

I have the following bash function and want to pass my own file types to the function. I wonder how should I do it.

greprc ()
  {
       grep -hir --exclude=\*.el --include=\*.{org,texi} "$@"
  }
  
Pietru
  • 371
  • 1
  • 14
  • 1
    It sounds like you are asking [How to pass parameters to function in a bash script?](https://unix.stackexchange.com/questions/298706/how-to-pass-parameters-to-function-in-a-bash-script) – steeldriver Jul 05 '21 at 11:36
  • 1
    It is more about how to pass variables to the grep command for --include and --exclude. Perhaps I can pass them as parameters to the function using the full `--exclude=\*.el --include=\*.{org,texi}` string? – Pietru Jul 05 '21 at 11:51

0 Answers0