1.开启子进程的两种方式: # 方式1: from multiprocessing import Process import time def task(name): print('%s is running'%(name)) time.sleep(2) print('%s is done'%name) if __name__ == '__main__': # p = Process(target=task,kwargs={'name':'子进程1'}) p = Process(target=…
1. vi /tmp/test.ksh #!/bin/ksh line='---------------------------------------------' pids=$(/usr/bin/ps -ef -o pid=) if [ $# -eq 0 ]; then read ans?"Enter port you would like to know pid for: " else ans=$1 fi for f in $pids do /usr/proc/bin/pfile…