MySQL Forums
Forum List  »  Newbie

Re: [SOLVED!] Ascii text boxes disappear when query output is redirected
Posted by: Michael Lueck
Date: August 21, 2010 03:25PM

Ken Butcher gets the prize for the correct answer!

Ken Butcher wrote:
> If you want to retain the table formatting, use the --table (-t) option

His site I found quite useful:
http://mainstreetanswers.org/bashs.php
and his answer solved the mystery of where the ascii art table was disappearing to.

The working syntax is as follows:

#!/bin/bash
MYSQL='/usr/bin/mysql -u uid --password=****** db'
$MYSQL -te 'SELECT DISTINCT `message`, `location`, `referer` FROM `watchdog` WHERE `referer` LIKE "%orgname.org%" AND `type` = "page not found" ORDER BY `location`, `referer`;'

And usage is as I posted originally:

./drupal_404-query.sh 2>&1 | /usr/bin/mailx -s "Test Query Email" root

Michael Lueck
Lueck Data Systems
http://www.lueckdatasystems.com/

Options: ReplyQuote




Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.