function server() { # 打开请求应答的server ./dgram_mod_req_rep server 11 & server_pid=$! && echo ${server_pid} # 开启bus ./dgram_mod_bus server 8 & server_pid=$! && echo ${server_pid} # 开启网络server ./test_net_mod_socket server 5000 & server_pid=$! && echo ${server_pid} } function client() { ./test_net_mod_socket client 5000 } function close() { ps -ef | grep -e "dgram_mod_req_rep" -e "net_mod_socket" -e "dgram_mod_bus" | awk '{print $2}' | xargs -i kill -9 {} ipcrm -a } function scp() { scp -P 100 -rp ../build basic@192.168.5.22:/data/disk2/test scp -rp ../build basic@192.168.20.10:/data3/workspace/wzq } case ${1} in "server") close server ;; "client") client ;; "close") close ;; "") close server client ;; *) echo "error input" exit 1 ;; esac