Say I have a set of piped commands in bash:
mysqldump mydatabase | head -1100 | tail -n 100
What is the correct / best way to treat that as one command, so I can capture the output.
I tried enclosing the commands in backticks (which as I understand opens a new shell, which seems unnecessary), but got an error.
`mysqldump mydatabase | head -1100 | tail -n 100 ` > output.txt
error mysqldump: Got errno 32 on write
Not sure if the error is related to the bash commands or the mysql (it worked before I added the backticks).
Anyway, I am more interested in how I can treat the piped commands as one / group them for capturing.