Bash - how can i pass variable to command and read its output
- by Skuja
In my bash script i want to execute command that will find lines in a file that starts with a keyword which is stored in a variable like this:
keyword="key"
result=(`cat path/to/my/file | grep '^$keyword'`)