MySQL ã® pager ã便å©ã ã£ã
mysql ã®ã³ã³ã½ã¼ã«ã§ grep ã¨ã使ããªãããªãã¨æã£ã¦ããã pager ã使ãã°åºæ¥ããã¨ãä»æ´ç¥ã£ãã
MySQL :: MySQL 5.1 ãªãã¡ã¬ã³ã¹ããã¥ã¢ã« :: 7.7.2 mysql Commands
http://dev.mysql.com/doc/refman/5.1/ja/mysql-commands.html
mysql ã®ããã³ããã§ä»¥ä¸ã®ããã« pager (ã¾ãã¯\P) ãæå®ããã°ããã
ã»grep
mysql> pager cat | grep hoge PAGER set to 'cat | grep hoge'
ã»ãã¡ã¤ã«ã«ä¿å
mysql> \P cat > ~/dump.txt PAGER set to 'cat > ~/dump.txt'
ã»less
mysql> \P less PAGER set to 'less'
less ã® -S ãªãã·ã§ã³ã使ãã¨ç»é¢ã®å¹
ã«åããã¦æãè¿ãããã横ã¹ã¯ãã¼ã«ãã§ããããã«ãªããã¨ãç¥ã£ããã
çµæã¬ã³ã¼ãã横ã«é·ã表示ãå´©ããå ´å㯠\G ã使ã£ã¦ããããã£ã¡ã®æ¹ãè¦ãããã
mysql> \P less -S PAGER set to 'less -S'
åºåãæ¨æºã«æ»ãã«ã¯ãnopager ã³ãã³ããå®è¡ããã
mysql> nopager PAGER set to stdout
ãã°ã¤ã³æã«ãªãã·ã§ã³ãæå®ãã¦ãããã
$ mysql --pager='less -S' -uroot -p