cat exec.sh #!/bin/sh log_file=/home/db/log for script in $(ls ${1}/*.sh 2>/dev/null) do echo $script if script_allowed $script then if [ -x $script ] then $script >>$log_file fi fi done script_allowed () { script=$1 if [ -r $script ] then ret_code=255 fi return $ret_code } sh exec.sh '/home/db/test'...
by lovevmwarer - Shell - 2008-06-27 15:04:54 阅读(1745) 回复(4)
#!/bin/sh exec perl -w -x $0 ${1+"$@"} # -*- mode: perl; perl-indent-level: 2; -*- #!perl -w ############################################################## ### ### ### cvs2cl.pl: produce ChangeLog(s) from `cvs log` output. ### ### ### #####################################################...
[code]#! /usr/bin/perl use strict; # 使用 IO::Socket 模組 use IO::Socket; # 取得命令列中的網頁位址,放入 $url 中 my $url=shift || die "您沒有輸入 url 網址!\n"; # 比對網頁位址是否合乎格式? my ($host, $file) = $url =~ m!http://([^/]+)(/[^\#]*)!; #(註1) # 若比對正確,才抓取 if ($host) { # 產生一個 IO::Socket::INET 物件 my $socket = IO::Socket::INET->new( PeerAddr => $host, # 指定主機位址...
Ask diag: when ypinit -m problem is as follow: warning: Group writable directory /var/yp/baseband.ut dbm map "Alias0":unsafe map file /var/yp/baseband.ut/mail.aliases: No such file or directory Cannnot create database for alias file /var/yp/baseband.ut/mail.aliases ***Error code 71 How to fix it?
installing oracle8.17 for inter 安装过程中到: installing askjdkhome1.0时;提示: cann't found /usr/local/java/java1.2.2 what can i do now?
installing oracle8.17 for inter 安装过程中到: installing askjdkhome1.0时;提示: cann't found /usr/local/java/java1.2.2 what can i do now?
-exec 必须由一个 ; 结束,而因为通常 shell 都会对 ; 进行处理,所以用 \; 防止这种情况。 {} 可能需要写做 '{}',也是为了避免被 shell 过滤 find ./ -type f -exec grep iceskysl {} /dev/null \; ./表示从当前目录找 -type f,表示只找file,文件类型的,目录和其他字节啥的不要 -exec 把find到的文件名作为参数传递给后面的命令行,代替{}的部分 -exec后便跟的命令行,必须用“ \;”结束 #find ./ -type f -name "*.cpp"...
1。 set a='echo abc' exec $a 2。 set a="echo abc" exec $a 执行第一个没问题,第二个ssh马上掉线。 [ 本帖最后由 angeljyt 于 2007-11-13 15:06 编辑 ]
请文如何在 tcl 脚本里面执行 ps -efw| grep "go to nsdut" 条命令, 我是这样写的 exec ps -efw|grep "go to nsdut" 但执行脚本不对,请高人指点!!!!!!!!!1