Putting the data passed to xargs twice in one line
问题 tmp-file contains: database_1 database_2 database_3 I want to run a command like "mysqldump DATABASE > database.sql && gzip database.sql" for each line in the above file. I've got as far as cat /tmp/database-list | xargs -L 1 mysqldump -u root -p I guess I want to know how to put the data passed to xargs in more than once (and not just on the end) EDIT: the following command will dump each database into its own .sql file, then gzip them. mysql -u root -pPASSWORD -B -e 'show databases' | sed