I have a question regarding the usage of functions in a command in bash. getRegex is my function, it is defined at the end of the the file. The command that I want to use is the following:
COUNT=`grep -rnE 'getRegex' $HOME/new`
Now I tried a lot of different variants but I cannot make it work, even if I split it in 2. The method works correctly if I call it the following way: getRegex. Any idea what I am missing? TIA
The key words to answer are “bash command substitution”, which you could find in
man bashor google.By the way, double quotes are really important here.
And