[20140415]灵活定制sqlplus的linesize.txt
各种显示器以及打开窗口的大小都是变化的,如果能即时修改linesize参数自动适应这种变化,那是最好的。
在linux执行:
$ stty -a
speed 38400 baud; rows 68; columns 237; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = ; eol2 = ; swtch = ; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;
-parenb -parodd cs8 -hupcl -cstopb cread -clocal -crtscts -cdtrdsr
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff -iuclc -ixany -imaxbel -iutf8
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke
--columns 237 就是当前的列宽度,如果设置这个参数,正好满足需要。
--参考链接http://berxblog.blogspot.com/2009/07/linesizesql.html,自己修改一点。
-- linesize.sql
--
--
-- set linesize according to stty
-- handle with care, as stty is not consistent over platform boundaries
--
set termout off
define _linesize_cmd1 = 'echo -n "set linesize " > /tmp/linesize.sql '
-- for solaris:
-- define _linesize_cmd2 = 'stty -a | awk -F''[ ;]'' ''/columns/ { print $7 }'' >>/tmp/linesize_&mycpid..sql'
-- for linux:
define _linesize_cmd2 = 'stty -a | awk -F''[ ;]'' ''/columns/ { print $9 }'' >>/tmp/linesize.sql'
HOST &_linesize_cmd1
HOST &_linesize_cmd2
@ '/tmp/linesize.sql'
undef _linesize_cmd1 _linesize_cmd2
set termout on
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/267265/viewspace-1142197/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/267265/viewspace-1142197/