Unix Shell 中的流程控制语句Windows系统
“karewen”通过精心收集,向本站投稿了8篇Unix Shell 中的流程控制语句Windows系统,下面就是小编给大家分享的Unix Shell 中的流程控制语句Windows系统,希望大家喜欢!
篇1:pl\sql中流程控制方式
pl\sql中流程控制方式
块
Java代码
declare
username varchar2(20);
begin
select t.ename into username from emp t where rownum=1;
dbms_output.put_line(username);
end;
2 oracle 中case when 用法
Java代码
declare
age number(6,2); ----这里的六代表总长度,2代表小数点后面的长度
begin
age:=&myage;
case age
when 10 then
dbms_output.put_line('you have 10 year');
when 20 then
dbms_output.put_line('you have 20 year');
when 30 then
dbms_output.put_line('you have 3o year');
else
dbms_output.put_line('I donot know you age');
end case;
end;
3 oracle 中loop循环的用法
Java代码
declare
q number :=0;
begin
loop
q:=q+1;
dbms_output.put_line('q='||q);
exit when q=10;
end loop;
end;
4.loop循环中另外的一种退出方法
Java代码
declare
q number :=0 ;
begin
loop
q:=q+ 1;
dbms_output.put_line( 'q='||q);
if q=10
then
exit;
end if ;
end loop ;
dbms_output.put_line('hello i barek'); ---exit跳出后这句号会执行
end;
5.loop循环中另外的一种
Java代码
declare
q number := 8;
begin
while q < 100 loop
q := q + 1;
dbms_output.put_line( 'hello world good ');
end loop;
end;
6.loop 的for用法
Java代码
declare
q number := 8;
begin
for c in 1..10 loop --- 要想从10到1 要在 in 的后面加上 reverse
dbms_output.put_line('c is '||c);
dbms_output.put_line('hello world good ');
end loop;
end;
7.goto语句的用法
Java代码
declare
sal number ;
begin
select t.sal into sal from emp t where rownum=1 ;
if sal<0
then
goto a;
else
goto b;
end if;
dbms_output.put_line('this is a');
dbms_output.put_line('this is b');
end;
篇2:Unix Shell 中的流程控制语句Windows系统
-------------------------------------------------------------------------------- 作者:joyo 与其他OS下的编程语言一样, UNIX 中的流程控制语句也是构成应用程序的基石,因此笔者认为有必要了解一下UNIX中的流程控制语句,如果你致力于走进UNIX程序世界
--------------------------------------------------------------------------------
作者:joyo
与其他OS下的编程语言一样,UNIX中的流程控制语句也是构成应用程序的基石。因此笔者认为有必要了解一下UNIX中的流程控制语句,如果你致力于走进UNIX程序世界的话。在介绍流程控制之前,我们先来看看test命令。test命令的参数是条件判断式,当条件为真时则传回非零值,而条件为假时则传回零。在所有的流程控制都必须用到test命令来判断真伪。
test $# = 0
如果执行这个程序没有参数时,会传回非零值代表“$# = 0”这个条件成立。反之则会传回零。
以下介绍各种流程控制:
1. if then
语法以及流程图如下
│ FALSE
<condition>―┐
│TRUE │
then-commands │
├――――┘
│
if (condition)
then
then-commands
fi
condition 是一个test命令。下文所介绍的各种流程中的condition如无特殊说明都是test命令。
┌―――――――――――┐
│if (test $# != 0) │
│ then │
│ echo Arg1: $1 │
│fi │
└―――――――――――┘
$ chkarg Hello
Arg1: Hello
$ chkarg
$
2. if then else
语法以及流程图如下
│ FALSE
<condition>―――――┐
│TRUE │
then-commands else-commands
├――――――――┘
│
if (condition)
then-commands
else
fi
3. if then elif
语法以及流程图如下
│ FALSE
<condition1>―┐
│TRUE │ FALSE
commands1 <condition2>―┐
│TRUE │ │
│ commands2 commands3
├―――――┴――― ┘
│
if (condition1)
then
commands1
elif (condition2)
then
commands2
else
commands3
commands3
fi
echo 'word 1: c'
read word1
echo 'word 2: c'
read word2
echo 'word 3: c'
read word3
if (test “$word1” = “$word2” -a “$word2” = “$word3”)
then
echo 'Match: words 1, 2, & 3'
elif (test “$word1” = “$word2”)
then
echo 'Match: words 1 & 2'
elif (test “$word1” = “$word3”)
then
echo 'Match: words 1 & 3'
elif (test “$word2” = “$word3”)
then
echo 'Match: words 2 & 3'
else
echo 'No match'
fi
4. for in
语法以及流程图如下
│ FALSE
┌―<arg-list还有东西吗?>―┐
│ │TRUE │
│ 从arg-list取得一项 │
│ 放到变数var │
│ │ │
│ commands │
└――――――┘ │
┌―――――――┘
│
for var in arg-list
do
commands
done
┌―――――――――――┐
│for a in xx yy zz │
│ do │
│ echo $a │
│done │
└―――――――――――┘
结果如下:
xx
yy
yy
zz
5. for
语法以及流程图如下
│ FALSE
┌―<参数中还有东西吗?>―┐
│ │TRUE │
│ 从参数中取得一项 │
│ 放到变数var │
│ │ │
│ commands │
└―――――┘ │
┌―――――――┘
│
for var
do
commands
done
┌―――――――――――┐
│for a │
│ do │
│ echo $a │
│done │
└―――――――――――┘
$lstarg xx yy zz
xx
yy
yy
zz
6. while
语法以及流程图如下
│ FALSE
┌―<condition>―┐
│ │TRUE │
│ commands │
└――――┘ │
┌――――┘
│
while (condition)
do
commands
done
┌―――――――――――――――┐
│number=0 │
│while (test $number -lt 10) │
│ do │
│ echo “$numberc” │
│ number=`expr $number + 1` │
│done │
│echo │
└―――――――――――――――┘
结果如下:
0123456789
7. until
语法以及流程图如下
│ TRUE
┌―<condition>―┐
│ │FALSE │
│ commands │
└――――┘ │
┌――――┘
│
until (condition)
do
commands
done
它和while 的不同只在於while 是在条件为真时执行回圈,而until 是在条件为假时执行回圈,
8. break及continue
这两者是用於for, while, until 等回圈控制下。break 会跳至done后面执行,而continue会跳至done执行,继续执行回圈。
9. case
语法以及流程图如下
│ TRUE
<str=pat1>――――commands1―┐
│FALSE TRUE │
<str=pat2>――――commands2―┤
│FALSE TRUE │
<str=pat3>――――commands3―┤
│FALSE │
├――――――――――――┘
│
case str in
pat1) commands1;;
pat2) commands2;;
pat3) commands3;;
esac
而pat 除了可以指定一些确定的字串,也可以指定字串的集合,如下:
* 任意字串
? 任意字元
[abc] a, b, 或c三字元其中之一
[a-n] 从a到n的任一字元
| 多重选择
┌―――――――――――――――┐
│echo 'Enter A, B, or C: c' │
│read letter │
│case $letter in │
│ A|a) echo 'You entered A.';;│
│ B|b) echo 'You entered B.';;│
│ C|c) echo 'You entered C.';;│
│ *) echo 'Not A, B, or C';; │
│esac │
└―――――――――――――――┘
10. 函数
格式如下
function-name
{
commands
}
而要呼叫此函数,就像在命令列下直接下命令一般。
jysww 回复于:-02-19 23:51:27UP!
原文转自:www.ltesting.net
篇3:登录控制的问题?Windows系统
请问在scoopenserver5.0.5中.如何控制终端的登录.采用的是 网络 终端.就是用这个ip地址的终端只能用业务前台的用户名登录.而不能用其它用户名登录.不采用密码.有什么方法. postlh 回复于:-04-14 18:49:23 管理好你的各级用户和口令呀 sdccf 回复于:200
请问在sco openserver 5.0.5中.如何控制终端的登录.采用的是网络终端.就是用这个ip地址的终端只能用业务前台的用户名登录.而不能用其它用户名登录.不采用密码.有什么方法.
postlh 回复于:2005-04-14 18:49:23管理好你的各级用户和口令呀
sdclearcase/“ target=”_blank“ >ccf 回复于:2005-04-14 20:55:28用户的.profile 文件中控制
giggle5 回复于:2005-04-15 10:17:49[quote:5b26a3c62e=”sdccf“]用户的.profile 文件中控制[/quote:5b26a3c62e]
要怎么控制呢?
giggle5 回复于:2005-04-17 14:22:28没有人回答?
sdccf 回复于:2005-04-17 14:34:17做判断,如果用户名不是要求的就exit
giggle5 回复于:2005-04-17 15:35:00能不能说具体点
styr 回复于:2005-04-17 18:45:39[quote:3f8992059f]在Unix系统中,有些应用需要只对某些终端开放,而对其他用户进行限制,如果要实现如上操作,只要将下面的shell程序加入到/etc/profile的文件中去,就可实现限制对tty1b终端号只能用“xtgl”这一用户登录,而不能用其他的用户登录系统。
# echo ”tty `tty`“
# if test `tty` = '/dev/tty1b';
# then
# if test $LOGNAME = ”xtgl“;
# then
# echo ”OK!“
# else
# echo ”You have not privilege to login in this term.“
# exit
# fi
# else
# echo
# fi
---- 另外,如果对应的用户没有设置密码,用户直接进入应用系统,则应该在对应用户目录下的.profile文件中加入以上代码,才能限制对应的终端号只能用对应的用户名进行登录,
---- 注: 以上代码在IBM AIX 、Sco Unix环境下测试通过。[/quote:3f8992059f]
giggle5 回复于:2005-04-18 10:54:47我的想法是:对于己于192.168.0.1-192.168.0.30这一网段内的终端只能用用户1和用户2登录到主机.而192.168.0.31-192.168.0.60这一网段的终端只能用用户3和用户4登录主机.如果操作人员在终端上输入了并不是该终端所属网段的用户,则就让它不能登录.其它的网段的终端以此类推.
giggle5 回复于:2005-04-27 13:42:23没有人回答么?!
天祥星辰 回复于:2005-04-27 14:46:26很简单的问题,每个用户作一个配置文件,.profile对配置文件进行效验 如果条件不匹配推出就可以了
styr 回复于:2005-04-27 17:28:21如果没有做tty绑定,先用 finger 或who -ux 滤出你的ip地址,
再修改一下上贴的shell,先判断 IP 合法性,再判断 LOGNAME ,就可以了
我们局的服务器做了vlte.net绑定,现在用finger who -ux
也得不到IP,实现不了,不知道你们的情况如何
giggle5 回复于:2005-04-27 19:39:31上面的能不能说明白点
styr 回复于:2005-04-28 09:43:12如果做了绑定,像我们的这种vltelnet绑定的,就得不到登录终端的IP地址,也就无法实现你从IP地址开始判断的要求.
aerfa 回复于:2005-04-28 10:45:00[quote:4bbda2570b=”styr“]如果做了绑定,像我们的这种vltelnet绑定的,就得不到登录终端的IP地址,也就无法实现你从IP地址开始判断的要求.[/quote:4bbda2570b]
你可以耕具TTYP号,查找vl*.cfg文件得到相应的IP地址啊
styr 回复于:2005-04-28 16:15:14/etc/vltelnetd.cfg里是有终端IP和对应的端口号,
经aerfa提醒,今晚就可以去做来试试,请各位高手指点
不过不知道版主的终端是否绑定,如果没绑定,那shell
就要再改一改了
原文转自:www.ltesting.net
篇4:Cisco路由配置语句Windows系统
启动接口,分配IP地址: router router enable router# router# configure terminal router(config)# router(config)# interface Type Port router(config-if)# no shutdown router(config-if)# ip address IP-Address Subnet-Mask router(config-if)# ^z
启动接口,分配IP地址:router>
router>enable
router#
router# configure terminal
router(config)#
router(config)# interface Type Port
router(config-if)# no shutdown
router(config-if)# ip address IP-Address Subnet-Mask
router(config-if)# ^z
配置RIP路由协议:30秒更新一次
router(config)# router rip
router(config-if)# network Network-Number <--通告标准A,B,C类网-->
router(config-if)# ^z
配置IGRP路由协议:90秒更新一次
router(config)# router igrp AS-Number <-- AS-Number范围1~65535-->
router(config-if)# network Network-Number <--通告标准A,B,C类网-->
router(config-if)# ^z
配置Novell IPX路由协议:Novell RIP 60秒更新一次
router(config)# ipx routing [node address]
router(config)# ipx maximum-paths Paths <--设置负载平衡,范围1~512-->
router(config)# interface Type Port
router(config-if)# ipx network Network-Number [encapsulation encapsulation-type] [secondary] <--通告标准A,B,C类网-->
router(config-if)# ^z
配置DDR:
router(config)# dialer-list Group-Number protocol Protocol-Type permit [list ACL-Number]
router(config)# interface bri 0
router(config-if)# dialer-group Group-Number
router(config-if)# dialer map Protocol-Type Next-Hop-Address name Hostname Telphone-Number
router(config-if)# ^z
配置ISDN:
router(config)# isdn swith-type Swith-Type <--配置ISDN交换机类型,中国使用basic-net3-->
router(config-if)# ^z
配置Frame. Relay:
router(config-if)# encapsulation frame-relay [cisco | ietf ]
router(config-if)# frame-relay lmi-type [ansi | cisco | q933a ]
router(config-if)# bandwidth kilobits
router(config-if)# frame-relay invers-arp [ Protocol ] [dlci ]
<--配置静态Invers ARP表:
router(config)# frame-relay Protocol Protocol-Address DLCI [ Broadcast ] [ ietf | cisco ] [ payload-compress | packet-by-packet ]
-->
<--设置Keepalive间隔:
router(config-if)# keepalive Number
-->
<--为本地接口指定DLCI:
router(config-if)# frame-lelay local-dlci Number
-->
<--子接口配置:
router(config-if)# interface Type Port.Subininterface-Number [ multipoint | point-to-point ]
router(config-subif)# ip unnumbered Interface
router(config-subif)# frame-lelay local-dlci Number
-->
router(config-if)# ^z
配置标准ACL:
router(config)# aclearcase/” target=“_blank” >ccess-list Access-List-Number [ permit | deny ] source [ source-mask ] <-- Access-List-Number 范围:1~99标准ACL;100~199扩展ACL;800~899标准IPX ACL;900~999扩展IPX ACL;1000~1099 IPX SAP ACL;600~699Apple Talk ACL-->
router(config)# interface Type Port
router(config-if)# ip access-group Access-List-Number [ in | out ]
router(config-if)# ^z
配置扩展ACL:
router(config)# access-list Access-List-Number [ permit | deny ] [ Protocol | Protocol-Number ] source source-wildcard [ Source-Port ] destination destination-wildcard [ Destination-Port ] [ established ]
router(config)# interface Type Port
router(config-if)# ip access-group Access-List-Number [ in | out ]
router(config-if)# ^z
配置命名ACL:
router(config)# ip access-list [ standard | extended ] ACL-Name
router(config [ std- | ext- ] nacl)# [ permit | deny ] [ IP-Access-List-Test-Conditions ]
router(config [ std- | ext- ] nacl)# no [ permit | deny ] [ IP-Access-List-Test-Conditions ]
router(config [ std- | ext- ] nacl)# ^z
router(config)# interface Type Port
router(config-if)# ip access-group [ACL-Name | 1~199 ] [ in | out ]
router(config-if)# ^z
配置DCE时钟:
router# show controllers Type Port <--确定DCE接口-->
router(confin-if)# clock rate 64000 <--进入DCE接口设置时钟速率-->
router(config-if)# ^z
配置PPP协议:
router(config)# username Name password Set-Password-Here <--验证方建立数据库-->
router(config)# interface Type Port
router(config-if)# encapsulation ppp <--启动PPP协议-->
router(config-if)# ppp outhentication [ chap | chap pap | pap chap | pap ] <--选择PPP认证-->
router(config-if)# ppp pap sent-username Name password Password <--发送验证信息-->
router(config-if)# ^z
PAP单向认证配置实例:
验证方:
router-server(config)# username Client password 12345 <--验证方建立数据库-->
router-server(config)# interface serial 0
router-server(config-if)# encapsulation ppp
router-server(config-if)# ppp authentication pap <--选择使用PAP实现PPP认证-->
router-server(config-if)# ^z
被验证方:
router-client(config-if)# encapsulation ppp
router-client(config-if)# ppp pap sent-username Client password 12345 <--发送验证信息-->
router-client(config-if)# ^z
PAP双向认证配置实例:
路由器 A:
routerA(config)# username B password 12345
routerA(config)# interface serial 0
routerA(config-if)# encapsulation ppp
routerA(config-if)# ppp authentication pap
routerA(config-if)# ppp pap sent-username A password 54321
routerA(config-if)# ^z
路由器 B:
routerB(config)# username A password 54321
routerB(config)# interface serial 1
routerB(config-if)# encapsulation ppp
routerB(config-if)# ppp authentication pap
routerB(config-if)# ppp pap sent-username B password 12345
routerB(config-if)# ^z
CHAP单向认证配置实例:
验证方:
router-server(config)# username router-client password 12345
router-server(config)# interface serial 0
router-server(config-if)# encapsulation ppp
router-server(config-if)# ppp authentication chap
router-server(config-if)# ^z
被验证方:
router-client(config-if)# encapsulation ppp
router-client(config-if)# ppp authentication chap
router-client(config-if)# ppp chap hostname router-client
router-client(config-if)# ppp chap password 12345
router-client(config-if)# ^z
CHAP双向认证配置实例:
路由器 A:
routerA(config)# username routerB password 12345
routerA(config)# interface serial 0
routerA(config-if)# encapsulation ppp
routerA(config-if)# ppp authentication chap
routerA(config-if)# ppp chap hostname routerA
routerA(config-if)# ppp chap password 54321
routerA(config-if)# ^z
路由器 B:
routerB(config)# username routerA password 54321
routerB(config)# interface serial 1
routerB(config-if)# encapsulation ppp
routerB(config-if)# ppp authentication chap
routerB(config-if)# ppp chap hostname routerB
routerB(config-if)# ppp chap password 12345
routerB(config-if)# ^z
Telnet使用:
routerA# terminal monitor <--可以传回在远端主机执行Debug命令的结果-->
routerA# telnet IP-Address [ Router-Name ] <--Telnet到指定的地址或名字的主机-->
routerB# [ exit | logout ] <--退出Telnet-->
routerB# ++<6>再按 <--挂起Telnet-->
routerA# show sessions <--显示当前所有Telnet的信息,包括Connect-Number -->
routerA# Connect-Number <--返回指定的Telnet连接-->
routerA# disconnect IP-Address [ Router-Name ] <--断开指定地址或名字的主机的连接-->
routerA# show user <--显示Telnet到本机的连接信息-->
routerA# clear line [ 0 | 1 | 2 | 3 | 4 ] <--断开指定Telnet到本机的连接-->
禁止任何Telnet到本机:
router(config)# line vty 0 4
router(config-line)# access-class ACL-Number
router(config)# ^z
设置主机名:
router(config)# hostname Set-Hostname
router(config)# ^z
router(config)# ^z
设置用户模式密码:
router(config)# line console 0
router(config-line)# login
router(config-line)# password Set-Password
router(config-line)# ^z
设置Telnet密码:
router(config)# line vty 0 4
router(config-line)# login
router(config-line)# password Set-Password
router(config-line)# ^z
设置特权模式密码:
router(config)# enable password Set-Password <--不加密的密码,明码-->
router(config)# enable secret Set-Password <--经过加密的密码-->
router(config)# ^z
给所有密码加密:
router(config)# service password-ancryption Set-Password-Here
router(config)# no service password-ancryption <--取消加密-->
router(config)# ^z
设置登录Banner:
router(config)# banner motd 分隔符 Set-Banner-InFORMation-Here 分隔符 <--前后分隔符一定要一致-->
设置接口的描述信息:
router(config-if)# description Set-Port-InFORMation-Here
router(config)# ^z
CDP的控制:
router(config-if)# cdp enable <--在指定端口启用CDP,缺省-->
router(config-if)# no cdp enable <--在指定端口关闭CDP-->
router(config)# cdp run <--使所有端口启用CDP-->
router(config)# no cdp run <--使所有端口关闭CDP-->
Ping的使用:
router# ping IP-Address
router# ping <--扩展Ping命令-->
Protocol [ip]:[ Protocol-Type ] <--选择协议类型-->
Target IP address:IP-Address <--输入测试地址-->
Repeat count [5]: <--选择发送的ICMP包数量-->
Datagram size [100]: <--选择每个包的大小-->
Timeout in seconds [2]: <--设置每个包的超时时间-->
Extended commands [n]:y <--使用扩展Ping命令-->
Sweep range of sizes [n]:
Tracke的使用:
router# trace IP-Address [ Host-Name ]
为Cisco 4000路由器指定媒体类型:
router(config-if)# media-type 10baset <--使AUI(默认)失效,改为使用RJ-45-->
router(config-if)# ^z
更改路由器启动顺序:
router(config)# boot system flash IOS-FileName
router(config)# boot system tftp IOS-FileName TFTP-IP-Address
router(config)# boot system rom
router(config)# ^z
修改寄存器数值:
router(config)# config-register value <--Cisco出厂默认value=0x2102,value范围:0x2100(进入ROM监视器),0x2101(使系统从ROM启动),0x2102~0x210F(使系统从NVRAM启动),
Cisco路由配置语句汇总Windows系统
,
0x1=0x2101,从最小位开始改变-->
在ROM监视器中更改寄存器数值:
>o/r value
路由器密码的恢复:
冷关机,然后再开机并在60秒内按< Ctrl>+进入ROM监视器模式
>o/r 0x2142 <--25xx型路由器-->或 >confreg 0x2142 <--16xx型路由器-->
router>I
router>n
router>enable
router# copy startup-config running-config
router# configure terminal
router(config)# enable secret New-Password
router(config)# config-register 0x2102
router(config)# ^z
router# copy running-config startup-config
router# reload
配置名称-主机入口:
router(config)# ip host Set-Name [ TCP-Port-Number ] IP-Address [ IP-Address 2 ]...
router(config)# ^z
定义DNS主机:
router(config)# ip name-server Server-Address [ Server-Address 2 ]...
router(config)# ^z
禁用DNS:
router(config)# no ip domain-lookup
router(config)# ^z
配置水平分割:
router(config-if)# ip split-horizon
router(config-if)# no ip split-horizon
router(config-if)# ^z
配置静态路由:
router(config)# ip route IP-Address Subnet-Mask [ Next-Hop-Address | Local-Out-Port ] [Distace ]
<--Distance范围:1~255,相当于优先权,越小越好。RIP=120;DSPF=110;IGRP=100;EIGRP=90-->
router(config)# ^z
配置缺省路由:
router(config)# ip defoult-network IP-Address <--动态缺省路由-->
router(config)# ip route 0.0.0.0 0.0.0.0 [ Next-Hop-Address | Local-Out-Port ] [Distace ] <--静态缺省路由-->
router(config)# ^z
其它命令:
router# show version
router# show running-config
router# show startup-config
router# show flash
router# show interface [ Type Port ]
router# show buffers
router# show protocol
router# show mem
router# show stacks
router# show processes
router# show cdp entry [ Device-Name ] <--显示指定邻居三层信息-->
router# show cdp neighbors
router# show cdp neighbors detail <---显示所有邻居三层信息->
router# show ip router
router# show ipx router
router# show host
router# show ip protocol
router# show ip interface Type Port
router# show ipx interface Type Port
router# show ipx servers
router# show ipx traffic
router# show access-lists [ ACL-Number ]
router# show isdn status
router# show dialer <--查看ISDN拨号信息-->
router# show isdn active
router# show frame-relay pvc
router# show frame-relay map
router# show frame-relay lmi
router# erase startup-config
router# reload
router# setup
router# copy running-config startup-config
router# copy startup-config running-config
router# copy tftp running-config
router# copy running-config tftp
router# debug ipx routing activity
router# debug ipx sap
router# debug isdn q921
router# debug isdn q931
router# debug dialer
router# debug ip rip
router# clear interface bri
,原文转自:www.ltesting.net
篇5:命令行CALL程序时传递数字参数总结Windows系统
设程序PgmA有参数Parm1,Parm2: 1)parm1(7S0)=276,parm2(7S2)=15.73 传递方式:CALLPGMAPARM('0000276''0001573') 2)parm1(7S0)=-276,parm2(6S2)=-15.73 传递方式:CALLPGMAPARM('-000276''-01573') 3)parm1(7P0)=276,parm2(7P2)=15.73 传递方式:CALLP
设程序 PgmA 有参数 Parm1, Parm2:
1)parm1(7S 0) = 276,parm2(7S 2) = 15.73
传递方式:CALL PGMA PARM('0000276' '0001573')
2)parm1(7S 0) = -276,parm2(6S 2) = -15.73
传递方式:CALL PGMA PARM('-000276' '-01573')
3)parm1(7P 0) = 276, parm2(7P 2) = 15.73
传递方式:CALL PGMA PARM( X'0000276F' X'0001573F')
4)parm1(6P 0) = 276 , parm2(6P 2)=15.73
传递方式:CALL PGMA PARM( X'F000276F' X'F001573F')
5)parm1(7P 0) = -276 , parm2(6P 2)=-15.73
传递方式:CALL PGMA PARM( X'0000276B' X'F001573B')
总结:
对于S类型的参数,只要按照字符串的形式,在没有数字的位置补0,不用输入小数点,就可以得到正确的结果,如果是负数,在第一位输入负号 - 即可,但是会占用一个数字位,7位的负数就只能输入6位数字了,
命令行CALL程序时传递数字参数总结Windows系统
,
对于P类型的参数,数字部分按照S类型的一样输入,还需要在字符串前加 X,并且如果长度为奇数,需要给字符串加 F 后缀,如果长度为偶数,需要在字符串的前后都加 F。如果是负数的,需要把字符串后面的F变为B。(X表示按16进制取值,由于P类型的数据存储方式是半个字节存储一个数字,所以需要在前后加其它的字母补齐空位。)
fzrxh 回复于:-04-02 07:46:11好呀
xuguopeng 回复于:2004-04-02 08:54:56经典~
qingzhou 回复于:2004-04-02 15:34:02好经验啊,很实用 :!: :!: :!:
aeiou 回复于:2004-04-03 12:58:09很多是他山之石,我只是整理了一下。大家觉得有用就好~
stephenxie 回复于:2004-04-05 14:27:29好高深噢!
高人就是高人!
:)
原文转自:www.ltesting.net
篇6:UNIX系统下部分控制代码介绍及其应用Windows系统
一、锁\开键盘代码 代码定义: 锁键盘:ESC[2h 开键盘:ESC[2l 应用: 1.直接在键盘上顺序敲入Esc+[+2+h四键,键盘即被锁
一、 锁\开键盘代码
代码定义:
锁键盘:ESC[2h
开键盘:ESC[2l
应用:
1.直接在键盘上顺序敲入Esc+[+2+h四键,键盘即被锁住,
2.在C语言程序显示字符串中包含锁代码:printf(″%c[2h字串″,'\033')。
3.在shell程序中用echo命令:echo″^[[2h字串″.注Esc键在vi编辑器中输入方法为:Ctrl+v,然后按一下Esc键,在屏幕上显示^[表示已输入。
同样显示开锁代码则键盘被解锁。
二、 删除字符代码
代码定义:
ESC[nX:清除光标右边n个字符,光标不动。
ESC[K或ESC[OK;清除光标右边全部字符,光标不动。
ESC[1K:清除光标左边全部字符,光标不动。
ESC[2K:清除整行,光标不动。
ESC[J或ESC[OJ:清除光标右下屏所有字符,光标不动。
ESC[1J:清除光标左上屏所有字符,光标不动。
ESC[2J或ESCc:清屏,光标移到左上角。
ESC[nM:删除光标之下n行,剩下行往上移,光标不动。
ESC[nP:删除光标右边n个字符,剩下部分左移,光标不动。
应用:
一般用于自己开发的编辑器中或涉及行编辑的应用程序中。
三、 插入字符代码
代码定义:
ESC[n@:在当前光标处插入n个字符。
ESC[nL:在当前光标下插入n行。
应用:
一般用于自己开发的编辑器中或涉及行编辑的应用程序中。
四、 移动光标
代码定义:
ESC[nA:光标上移n行。
ESC[nB:光标下移n行。
ESC[nC:光标右移n个字符。
ESC[nD:光标左移n个字符。
ESC[n;mH :光标定位到第n行m列(类似代码ESC[n;mf)。
应用:
1.一般用于自己开发的编辑器中或涉及行编辑的应用程序中。
2.用shell编辑的菜单程序中定位光标,如:
echo″^[[10;30H请选择:[ ]^[[9C\c″,则先把光标定位到10行30列,然后显示″请选择[ ]″,最后光标右移9个符定位到中括号内等待用户响应。
五、 定义字符显示属性代码
代码定义:
ESC[p;p;p;……m 其中属性值p可以是一个或多个,具体定义如下:
p 含义
0 清除所有属性
1 高亮度显示
4 下划线(如果硬件支持的话)
5 闪烁(如果硬件支持的话)
25 无闪烁
7 反场(前背景交换)
27 无反场
8 隐藏(不显示)
10 选择基本字体
11 选择第一替代字体;让ASCII值小于32的字符显示时直接取自ROM芯片内
12 选择第二替代字体;在作为ROM字符显示之前先压缩扩展高位ASCII码值
30 前景黑色
31 前景红色
32 前景绿色
33 前景褐色
34 前景蓝色
35 前景紫色
36 前景蓝绿色
37 前景白色
38 开启下划线标志;白色前景用白色下划线
39 关闭下划线标志
40 背景黑色
41 背景红色
42 背景绿色
43 背景褐色
44 背景蓝色
45 背景紫色
46 背景蓝绿色
47 背景白色
应用:
unix系统提供的setcolor命令是以行为单位改变颜色,在实际运用中有它的局限性,上面提到的控制代码在日常生活中用得最多,尤其适合于彩色弹出式立体菜单的设计。如我设计的中心机房值班程序,由于用了这些控制代码,界面非常友好。
六、其它代码
代码定义:
ESC7:保存当前光标位置参数及字符属性,
ESC8:恢复保存的光标位置参数及字符属性。
\n :插入换行符
\t :插入一个Tab键。
\r :插入回车符。
^G :插入响铃符(pc嗽叭鸣叫一次),在vi中按Ctrl+g即可输入。
\c :用于shell程序中,不换行。
应用:
1.用户界面设计。
2.用于中心机房向储蓄柜面发通知的程序中(结合实达终端屏幕保存代码ESC[/n;mr__保存从n行到m行的内容,恢复代码ESC[/11)
七、应用举例
1.彩色立体菜单(shell语言):
setcolor-b white
clear
while true
do
echo″
^[[8;20H^[[34;43m┍―――――――――┒^[[47m
^[[9;20H^[[34;43m | 1 日 间 业 务 | ^[[40m ^[[47m
^[[10;20H^[[34;43m| 2 环 境 维 护 | ^[[40m ^[[47m
^[[11;20H^[[34;43m| 请 选 择 [ ]| ^[[40m^[[47m
^[[12;20H^[[34;43m┕ ┛^[[40m^[[47m
^[[13;22H^[[40m ^[[47m
echo″ ^[[11;40H\c″
read aclearcase/“ target=”_blank“ >cc
done
2.向储蓄所发通知(C语言):
#include
main
{
printf(″%c7%c[/2;4r″,'\033',\033');
printf(″%c[2;5H%c[2K 紧急通知 ″,' \033','\033');
printf(″%c[3;5H%c[2K由于线路问题,今天不办新余市通存通兑业务“,’[033’,’\033’);
printf(″%c[4;5H%c[2K 中心机房 .11.20%c8″,'\033','033','\033');
fflush(stdout);
sleep(10);
printf “%c[/11″,’\033’);
fflush(stdout);
}
说明:该程序首先保存光标位置,同时保存2至4行内容 ,接着定位光标到2行5列,清除该行原先内容,然后显示“紧急通知”字样,通知显示完后立即恢复光标位置,然后等待10秒钟后恢复屏幕原先内容 。
rengongpu 回复于:2003-01-03 19:43:28好东西。
lcz88990200 回复于:2003-01-03 20:01:19很好
菜虾 回复于:2003-01-04 03:40:21好东东,请多多指点
cxzty 回复于:2003-01-04 10:47:57真是个好东西呀
lovqing 回复于:2003-01-04 11:52:27up
study 回复于:2003-01-04 15:47:05好东西!
flybirdxp 回复于:2003-01-04 15:52:31好东西
johnsilver 回复于:2003-01-04 18:03:14我原来也从脚本中收集了一些控制字符,但没有htldm的全,不错,感谢你.
jysww 回复于:2003-01-04 18:58:09好东西! 好东西!
RootZero 回复于:2003-01-05 00:46:00路过,收藏
linziwei 回复于:2003-01-05 10:34:18另存为..........
大梦 回复于:2003-01-05 12:05:59好东西!
xzh 回复于:2003-01-05 14:19:56谢谢!
天明700 回复于:2003-01-06 17:08:17佩服,佩服,
老兄,你太棒了!
收下,
谢谢!!!!!!!
cqdxs 回复于:2003-01-11 13:28:49不错
sensir 回复于:2003-01-11 14:46:08GOOD
原文转自:www.ltesting.net
篇7:各终端型号 串口控制命令简介Windows系统
[b:cec73a9883]北大方正的 网络 终端/WYSE终端可以很好的支持/兼容主流终端厂商的所有控制序列下面列出部分常用串口序列[/b:cec73a9883] 辅口仿真实达命令 'Esc[/50h允许辅口操作 'Esc[/50l禁止辅口操作 'Esc[/51h以后主机发送到终端的数据将全部送给辅口 'E
[b:cec73a9883]北大方正的网络终端 /WYSE终端 可以很好的支持/兼容主流终端厂商的所有控制序列 下面列出部分常用串口序列[/b:cec73a9883]
辅口仿真实达命令
'Esc[/50h 允许辅口操作
'Esc[/50l 禁止辅口操作
'Esc[/51h 以后主机发送到终端的数据将全部送给辅口
'Esc[/51l 主机结束向辅口送数据
'Esc[/53h 辅口内容直接送主机
'Esc[/53l 辅口内容前加80H,后加81H后送主机
'Esc[/54l 终端收到1个字符即向主机送1个字符
'Esc[/54h 辅口送出的字符暂存在终端内只有当接收回车后才一起送 到主机,
选择当前工作辅口和其通讯参数的命令如下: '
选中辅口1:Esc!P1;P2;P3;P4Y 或Esc!Y '
选中辅口2:Esc!P1;P2;P3;P4Z 或Esc!Z '
选中辅口3:Esc!P1;P2;P3;P4X 或Esc!X '
选中辅口4:Esc!P1;P2;P3;P4U 或Esc!U '
其中P1为设置波特率: '
P1=0为9600PBS P1=1为4800PBS P1=2为2400PBS P1=3 1200PBS
P1=4为900PBS P1=5为600PBS P1=6为300BPS P1=7为150BPS '
'P1=8为75BPS P1=9为800BPS P1=10为19200BPS '
'P2为奇偶校验: '
'P2=0为无校验 P2=1为奇校验 P2=2为偶校验 '
'P3为数据位数: '
'P3=0为8位数据位 P3=1为7位数据位 '
'P4为设置停止位数: '
'P4=0为1位停止位 P4=1为2位停止位。 '
'5.2 辅口仿真南天命令 '
'Esc%A 禁止辅口操作 '
'Esc%B 允许辅口1操作 '
'Esc%K 允许辅口2操作 '
'Esc%C 允许辅口3操作 '
'Esc%D 允许辅口4操作 '
辅口仿真国光命令 '
'Esc[/10h 进入密码键盘控制 '
'Esc[/10l 退出密码键盘控制 '
'辅口控制命令 '
'1.Esc[/P1;P2;(P3;P4;P5;P)6M '
'其中: '
P1:辅口选择 1,2,3,4 '
P2:0 - 集中方式 1 - 单个方式 '
P3:设置波特率: '
0 - 75 1 - 110 2 - 150 3 - 300 4 - 600 5 - 1200 '
6 - 2400 7 - 4800 8 - 9600 9 - 19200 '
P4为奇偶校验: '
P4=0为无校验 P4=1为奇校验 P4=2为偶校验 '
P5为数据位数: '
P5=0为8位数据位 P5=1为7位数据位 '
P6为设置停止位数: '
P6=0为1位停止位 P6=1为2位停止位 '
注:其中P3,P4,P5,P6参数可忽略 '
2.Esc[/M 退出辅口控制 '
3.Esc[/Pn|DATA...| 向被选通的辅口Pn发送数据DATA '
辅口仿真长城命令 '
Esc[> 选通辅口1(进入主串直通辅口1的通信方式) '
'Esc[1> 选通辅口2(进入主串直通辅口2的通信方式) '
'Esc[2> 选通辅口3(进入主串直通辅口3的通信方式) '
'Esc[3> 选通辅口4(进入主串直通辅口4的通信方式) '
'Esc[< 关闭辅口 '
辅口仿真新大陆命令 '
'Esc[/50;Pnh 打开辅口;Pn是辅口号:Pn = 1, 2, 3, 4 '
'5.6 辅口仿真牡丹命令 '
'Esc[/50h 允许辅口1输入 '
'Esc[/50l 发送数据给辅口1 '
'Esc[/51h 允许辅口2输入 '
'Esc[/51l 发送数据给辅口2 '
'Esc[/52h 允许辅口3输入 '
'Esc[/52l 发送数据给辅口3 '
'Esc[/53h 允许辅口4输入 '
'Esc[/53l 发送数据给辅口4 '
'Esc[/55h 禁止辅口输入 '
Esc[/55l 禁止发送数据给辅口 '
辅口仿真彗智命令 '
'辅口一:开启“Esc!45;1m” 关闭“Esc!45;0m” '
'辅口二:开启“Esc!54;1m” 关闭“Esc!54;0m” '
'辅口三:开启“Esc!60;1m” 关闭“Esc!60;0m” '
'辅口四:开启“Esc!65;1m” 关闭“Esc!65;0m” '
'Esc!b< 数据....>Esc!P把数据打包发到开启的辅口,
'
'注:各辅口对应的是哪个辅串口由系统设置的”辅口设置“中的”对应辅口“'
'确定! '
――――――――――――――――――――――――――――――――
[b:cec73a9883]北大方正 网络终端/WYSE终端 技术支持 qq 20774381 欢迎联系提供样机[/b:cec73a9883]
ld1949 回复于:-07-05 17:00:29俺正在找这方面的资料,多谢!
sdclearcase/” target=“_blank” >ccf 回复于:2004-07-06 08:04:54好,不错,这方面的资料不好找。
UnKnow365 回复于:2004-07-08 09:16:46ok!
原文转自:www.ltesting.net
篇8:求助:请问如何控制RPG报表的字体大小。Windows系统
qingzhou 回复于:2005-01-17 17:44:33再次建议你从改变打印SESSION的驱动属性、页面设置等配置角度考虑、从而得出是否可以用最简便办法去解决问题。
CHGPRTF这个编译PRTF的命令常用于调整报表的行、宽间距、强制换页、套打等,如果需要整体报表改动、如左右移动、建议通过RLU改变PRTF、或者通过移动纸张位置来解决问题(如果不想修改PRTF的话,很古板办法)。
在RLU设计PRTF时,可以设定字体大小。
我还是觉得可以试试直接调整打印SESSION的页面设置来解决问题、简单而且安全。
Vivian-wu 回复于:2005-01-17 17:51:34[quote:4beeac9c66=“qingzhou”]再次建议你从改变打印SESSION的驱动属性、页面设置等配置角度考虑、从而得出是否可以用最简便办法去解决问题。
CHGPRTF这个编译PRTF的命令常用于调整报表的行、宽间距、强制换页、套打等,如果需要整体报表改动、..........[/quote:4beeac9c66]
如果改变打印SESSION, 是不是所有的报表的格式(字体,方向等), 都是
固定的? 如果企不有所冲突?
yoyoage 回复于:2005-01-18 21:07:59首先,最直接的方法是修改CPI的值,改变字体的宽度。但是这样不是直接修改字体的大小。
另外,我提供一种思路,先看看你的机器上有没有安装psf/400
如果有,可以把prtf的printer device type改成*apfds( 默认为*scs)
然后设置相应的Font character set and point size 。但是我还需要进一步测试这个是不是和建立printer session的设置完全无关的。
另外,补充一下上面qingzhou提到的一点,如果要把报表内容整体移动,也就是改变报表的页面边距,是可以通过CHGPRTF实现的,但前提也是你的机器安装了PSF/400,也就是支持APFDS,
要修改两个keyword值:
Printer Device Type--〉*apfds
Front margin:
offset down-->设置顶部的边距(单位以参数*UOM中的设置为准)
offset across-->左边距
qingzhou 回复于:2005-01-19 09:22:09“首先,最直接的方法是修改CPI的值,改变字体的宽度。但是这样不是直接修改字体的大小。 ”
看看图片的解说、很显然CPI不是改变字体大小的参数。
qingzhou 回复于:2005-01-19 09:28:24“另外,补充一下上面qingzhou提到的一点,如果要把报表内容整体移动,也就是改变报表的页面边距,是可以通过CHGPRTF实现的,[color=red:3bd15d5c39]但前提也是你的机器安装了PSF/400,也就是支持APFDS[/color:3bd15d5c39]。 要修改两个keyword值:
Printer Device Type--〉*apfds
Front margin:
offset down-->设置顶部的边距(单位以参数*UOM中的设置为准)
offset across-->左边距”
补充的很好!!!
如果本地400没有安装PSF/400这个付费的LICPGM,那就只好委屈自己利用RLU修改PRTF了。
作为AS/400推出的新型的解决办法、推荐为精彩帖子备案存档。
原文转自:www.ltesting.net
【Unix Shell 中的流程控制语句Windows系统】相关文章:






文档为doc格式