[root@master ~]# .sh #!/bin/bash exec >> /tmp/.log >>/tmp/.log date ldkkdfkslfds date [root@master ~]# ./.sh [root@master ~]# .log Sat Jun :: UTC ./.: ldkkdfkslfds: command not found Sat Jun :: UTC Sat Jun :: UTC ./.: ldkkdfkslfds: command not
文件A中的exec(),调到了文件B中的方法,提示name is not defined exec()调用时,提示方法没有定义 试过了的方法: 1.百度上说是局部变量或者是全局变量之间的文件,然后在exec()方法后加了globals(),加上这个后重启,重启之后,上一个方法初始化浏览器的driver,提示没有defind,driver局部,不能在全局里面访问,定义一个全局变量driver,重启,还是提示'presetmethod' is not defined 2.在process文件,即使用
Package exec runs external commands. It wraps os.StartProcess to make it easier to remap stdin and stdout, connect I/O with pipes, and do other adjustments. Unlike the "system" library call from C and other languages, the os/exec package intenti