Given a log file named input
. You have to write a bash script which prints all the lines which contains mysql commands.
Note
mysql
commands start with mysql::
.Example:
Assume that the input
has the following content:
mysql:: SELECT * FROM courses;
rails:: Course.all
mysql:: SELECT id FROM courses;
rails:: Course.pluck(:id)
Then your bash script should output the following:
mysql:: SELECT * FROM courses;
mysql:: SELECT id FROM courses;
Our engineers were able to write this much code, can you complete it for us?
cat input | grep
NOTE: You only need to implement the given function. Do not read input, instead use the arguments to the function. Do not print the output, instead return values as specified. Still have a question? Checkout Sample Codes for more details.