Skip to main content
added 111 characters in body
Source Link
forcefsck
  • 8k
  • 35
  • 31

Aliases in bash do not take parameters (as already pointed out), so when you need something like that you can use bash functions (like the one provided by @l0b0).

But what you are trying to achieve here, can be done in a better way by using only grep.

grep -r --color --include="*.txt" " my_text " ./

BTW, fg is a shell built in command, an important one. You should avoid using it as a name for aliases or functions.

EDIT: in a function

$ ffg() { rgrep --color --include="$1" "$2" ./; }
$ ffg "*.txt" " my_text "

Aliases in bash do not take parameters (as already pointed out), so when you need something like that you can use bash functions (like the one provided by @l0b0).

But what you are trying to achieve here, can be done in a better way by using only grep.

grep -r --color --include="*.txt" " my_text " ./

BTW, fg is a shell built in command, an important one. You should avoid using it as a name for aliases or functions.

Aliases in bash do not take parameters (as already pointed out), so when you need something like that you can use bash functions (like the one provided by @l0b0).

But what you are trying to achieve here, can be done in a better way by using only grep.

grep -r --color --include="*.txt" " my_text " ./

BTW, fg is a shell built in command, an important one. You should avoid using it as a name for aliases or functions.

EDIT: in a function

$ ffg() { rgrep --color --include="$1" "$2" ./; }
$ ffg "*.txt" " my_text "
Source Link
forcefsck
  • 8k
  • 35
  • 31

Aliases in bash do not take parameters (as already pointed out), so when you need something like that you can use bash functions (like the one provided by @l0b0).

But what you are trying to achieve here, can be done in a better way by using only grep.

grep -r --color --include="*.txt" " my_text " ./

BTW, fg is a shell built in command, an important one. You should avoid using it as a name for aliases or functions.