fix(xiaoyuzhou): macOS BSD grep compat — replace grep -oP with perl -ne#290
Open
hymansun wants to merge 1 commit intoPanniantong:mainfrom
Open
fix(xiaoyuzhou): macOS BSD grep compat — replace grep -oP with perl -ne#290hymansun wants to merge 1 commit intoPanniantong:mainfrom
hymansun wants to merge 1 commit intoPanniantong:mainfrom
Conversation
…mpat `grep -oP` (PCRE) is a GNU extension and not available in BSD grep shipped with macOS, causing transcribe_xiaoyuzhou.sh to fail at the page-parsing step on every macOS install: grep: invalid option -- P ❌ 无法从页面提取音频链接 Switch the three affected sites to `perl -ne`. macOS ships perl by default, so this introduces no new dependency and works identically on Linux. Closes Panniantong#289 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
transcribe_xiaoyuzhou.shfailing on every macOS install withgrep: invalid option -- Pgrep -oP(PCRE) is a GNU extension and is not available in BSD grep that ships with macOSperl -ne— macOS ships perl by default, so no new dependency, and works identically on LinuxCloses #289
What changed
agent_reach/scripts/transcribe_xiaoyuzhou.sh, lines 38, 39, 114:Net change: 3 insertions, 3 deletions. No behavior change on Linux; fixes the macOS path entirely.
Test plan
Lint: shell still parses (
bash -n agent_reach/scripts/transcribe_xiaoyuzhou.sh)End-to-end on macOS 14 (Apple Silicon, bash 3.2, BSD grep, ffmpeg 8.1, Python 3.14, agent-reach 1.4.0): full transcription of
https://www.xiaoyuzhoufm.com/episode/69f2d432bb3ffa11e59cc5b0(9:05, 8.4MB → 4MB mono mp3 → 1 chunk → Groq Whisper large-v3 → 2561 字 markdown). Sample run:Linux smoke (any maintainer with a Linux box): same command should still work —
perlregexes are equivalent to the prior PCRE patterns.🤖 Generated with Claude Code