system 函数:
[oracle@jhoa 10]$ cat 1.pl
system "date";
[oracle@jhoa 10]$ perl 1.pl
Sat Oct 11 15:39:51 CST 2014
[oracle@jhoa 10]$ cat 1.pl
system "sleep 60";
[oracle@jhoa ~]$ ps -ef | grep 1.pl
oracle 8796 7930 0 15:40 pts/0 00:00:00 perl 1.pl
oracle 8835 8801 0 15:40 pts/1 00:00:00 grep 1.pl
[oracle@jhoa ~]$ ps -ef | grep 8796
oracle 8796 7930 0 15:40 pts/0 00:00:00 perl 1.pl
oracle 8797 8796 0 15:40 pts/0 00:00:00 sleep 60
oracle 8837 8801 0 15:40 pts/1 00:00:00 grep 8796
[oracle@jhoa ~]$ ps -ef | grep 8797
oracle 8797 8796 0 15:40 pts/0 00:00:00 sleep 60
oracle 8839 8801 0 15:40 pts/1 00:00:00 grep 8797
会创建一个子进程来运行sleep 命令,并且它继承了Perl的标准输入,标准输出和标准出错
[oracle@jhoa 10]$ cat 2.pl
unless (syste
perl system和exec 调用
最新推荐文章于 2023-08-17 12:10:44 发布