gpt4 book ai didi

bash - 用于捕获进程 ID 并在存在时将其杀死的 Shell 脚本

转载 作者:行者123 更新时间:2023-11-29 08:40:19 24 4
gpt4 key购买 nike

<分区>

我试过这段代码,但它不起作用

#!/bin/sh

#Find the Process ID for syncapp running instance

PID=`ps -ef | grep syncapp 'awk {print $2}'`

if [[ -z "$PID" ]] then
Kill -9 PID
fi

它在 awk 附近显示错误。

请提出任何建议。

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com