![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Parse String Using Sed | racbern | Shell Programming and Scripting | 4 | 04-23-2008 09:14 AM |
| how to parse this string | hcliff | Shell Programming and Scripting | 13 | 04-02-2008 01:43 AM |
| parse xml | bin-doph | High Level Programming | 5 | 03-15-2004 08:19 AM |
| How to parse.. | natter | Shell Programming and Scripting | 8 | 05-22-2003 06:11 AM |
| Parse | nguda | Shell Programming and Scripting | 7 | 05-16-2002 06:10 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
||||
|
||||
|
Parse
I need a script that will always return an engine of table, which not
depends on the table structure. I need it to be done exactly from the "show create table ..." statement. If there is a easiest way, except "show table status", please write. Code:
mysql -u root db -sBe "show create table table" table CREATE TABLE `dtt` (\n `id` int(11) DEFAULT NULL,\n `dt` datetime DEFAULT NULL,\n `tp` enum('start','stop') DEFAULT NULL\n) ENGINE=MyISAM DEFAULT CHARSET=latin1 |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
What's wrong with this (for MySQL >=5 IIRC):
Code:
$ mysql -u root -NBe 'select engine from information_schema.tables where table_name="user"' MyISAM Code:
$ mysql -u root -NBe 'show create table mysql.user'|grep -o 'ENGINE=[^ ]*' ENGINE=MyISAM Code:
$ engine="$(mysql -u root -NBe 'show create table mysql.user'|grep -o 'ENGINE=[^ ]*')"
$ echo "${engine#*=}"
MyISAM
Last edited by radoulov; 01-23-2008 at 03:55 PM. |
||||
| Google The UNIX and Linux Forums |