Peng Yu How to enable tabular output when reading command from file?
Oct 16, 2011; 11:36
Peng Yu
How to enable tabular output when reading command from file?
Hi,
~/linux/test/mysql/mysql/SELECT$ ./main.sh name date type remark Fluffy 1995-05-15 litter 4 kittens, 3 female, 1 male Buffy 1993-06-23 litter 5 puppies, 2 female, 3 male Buffy 1994-06-19 litter 3 puppies, 3 female Chirpy 1999-03-21 vet needed beak straightened Slim 1997-08-03 vet broken rib Bowser 1991-10-12 kennel Fang 1991-10-12 kennel Fang 1998-08-28 birthday Gave him a new chew toy Claws 1998-03-17 birthday Gave him a new flea collar Whistler 1998-12-09 birthday First birthday ~/linux/test/mysql/mysql/SELECT$ cat main.sh ^[#!/usr/bin/env bash
mysql -hlocalhost -uuser < main.sql
~/linux/test/mysql/mysql/SELECT$ cat main.sql use test select * from event;
============ The above command doesn't print as formatted in the following. I'm wondering what options I should use to produce a result similar to the following.
====================mysql> select * from event -> ; +----------+------------+----------+-----------------------------+ | name | date | type | remark | +----------+------------+----------+-----------------------------+ | Fluffy | 1995-05-15 | litter | 4 kittens, 3 female, 1 male | | Buffy | 1993-06-23 | litter | 5 puppies, 2 female, 3 male | | Buffy | 1994-06-19 | litter | 3 puppies, 3 female | | Chirpy | 1999-03-21 | vet | needed beak straightened | | Slim | 1997-08-03 | vet | broken rib | | Bowser | 1991-10-12 | kennel | | | Fang | 1991-10-12 | kennel | | | Fang | 1998-08-28 | birthday | Gave him a new chew toy | | Claws | 1998-03-17 | birthday | Gave him a new flea collar | | Whistler | 1998-12-09 | birthday | First birthday | +----------+------------+----------+-----------------------------+ 10 rows in set (0.03 sec)
-- Regards, Peng
-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/mysql?unsub=listsearcharchive@lassosoft.com
Oct 16
Dan Nelson Re: How to enable tabular output when reading command from file?
Oct 16, 2011; 21:57
Dan Nelson
Re: How to enable tabular output when reading command from file?
Search
Lasso Programming
This site manages and broadcasts several email lists pertaining to Lasso Programming and technologies related and used by Lasso developers. Sign up today!