Skip to content

[Help] ./record.sh: line 11: pgrep: command not found #152

Closed

Description

@Timmmmmms

大佬这是怎么回事,windows系统通过 Git Bash 运行:./record.sh
命令报错:
image

Activity

  1. changed the title [-][Help] nohup: failed to run command 'blrec': No such file or directory[/-] [+][Help] ./record.sh: line 11: pgrep: command not found[/+] on Jan 14, 2025
  2. timerring commented on Jan 14, 2025

    @timerring
    Owner

    我在 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 写个启动脚本。

  3. self-assigned this
    on Jan 14, 2025
  4. timerring commented on Jan 16, 2025

    @timerring
    Owner

    思来想去还是想复杂了,其实没有必要专门写 windows 下的 bat 脚本,我把 pgrep 换成最基础的管道命令配合查找就好其实。稍后我 push 一版。

  5. moushicheng commented on Jan 17, 2025

    @moushicheng

    @timerring 我在windows下是直接运行blrec的,其实我可以写一个给windows用的脚本,需要吗?

  6. timerring commented on Jan 17, 2025

    @timerring
    Owner

    @timerring 我在windows下是直接运行blrec的,其实我可以写一个给windows用的脚本,需要吗?

    可以的,欢迎 PR

  7. added a commit that references this issue on Jan 18, 2025
    f0c282e
  8. added a commit that references this issue on Jan 18, 2025
    4a5f2b3
  9. Repository owner locked and limited conversation to collaborators on May 1, 2025
  10. converted this issue into a discussion #313 on May 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions