I have a script which runs a mysql query on multiple database. i have it logging the query which was run to a file. When i pass in the query it contains new lines, but in the log file its is all on one line. Multi line queries are easier to read.
e.g:
$ sh run_query.sh 'CREATE TABLE`table` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`field1` int(10) unsigned NOT NULL,
`field2` int(10) unsigned NOT NULL,
PRIMARY KEY (`id`),
ENGINE=InnoDB;'
Is it possible for bash to keep the new lines in a passed variable?
run_query.sh?