Skip to content
Discussion options

You must be logged in to vote

我在 shell 里写的 kill -9 $(pgrep -f blrec) pgrep 是一个用于查找进程 ID(PID)的命令,其全称为 "process grep"。它会根据指定的条件在系统的进程表中查找进程,并返回符合条件的进程的进程 ID。

这里我主要是防止用户重启时打开多个 blrec 录制进程出现 bug,所以在启动脚本里 kill 上一个 blrec 进程。 确保同一时间内只会有一个 blrec 进程在运行,可能在 windows 中并没有这个命令。

不过这并不影响程序的正常运行,只是需要在重启的时候要注意,在 windows 中可以通过 tasklist | findstr /i "blrec" 查找进程 PID,然后 taskkill /PID <the_blrec_id> /F 终止录制进程,完成同样的操作。

我后面可以针对 windows 写个启动脚本。

Replies: 4 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by timerring
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
enhancement New feature or request
3 participants
Converted from issue

This discussion was converted from issue #152 on May 01, 2025 05:29.