I'm using a piped command to migrate a big production DB from one host to another using this command:
mysqldump <someparams> | pv | mysql <someparams>
And I need to extract the line 23 (or let's say the first X lines) (saved as file or simply in bash output) from the SQL passing from one server to another.
What I've tried:
Concatenate in output
less
, at least to see the output scrolling, but no luckmysqldump <someparams> | pv | mysql <someparams> | less
Read about
sed
, but it's not useful to meUsing head to write to a file, but it is empty
mysqldump <someparams> | pv | mysql <someparams> | head -n 25 > somefile.txt
The only requirement I have is that I cannot save this .sql file.
Any idea?
Thanks