-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Improve installation instructions for Raspberry Pi OS to work in zsh #12641
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
PoliCheck Scan ReportThe following report lists PoliCheck issues in PR files. Before you merge the PR, you must fix all severity-1 and severity-2 issues. The AI Review Details column lists suggestions for either removing or replacing the terms. If you find a false positive result, mention it in a PR comment and include this text: #policheck-false-positive. This feedback helps reduce false positives in future scans. ✅ No issues foundMore information about PoliCheckInformation: PoliCheck | Severity Guidance | Term |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR improves the Raspberry Pi OS installation instructions by adding the -E flag to the echo command to ensure compatibility with both bash and zsh shells. The issue occurs because zsh interprets backslash escape sequences (like \n) in the JSON response from the GitHub API by default, which causes the jq command to fail.
Key Changes:
- Modified the
echocommand to useecho -Eto explicitly disable interpretation of backslash escape sequences in the shell variable
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| bits=$(getconf LONG_BIT) | ||
| release=$(curl -sL https://api.github.com/repos/PowerShell/PowerShell/releases/latest) | ||
| package=$(echo $release | jq -r ".assets[].browser_download_url" | grep "linux-arm${bits}.tar.gz") | ||
| package=$(echo -E $release | jq -r ".assets[].browser_download_url" | grep "linux-arm${bits}.tar.gz") |
Copilot
AI
Jan 7, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The variable $release should be quoted to prevent word splitting and globbing issues. Additionally, while -E works for compatibility between bash and zsh, using printf '%s\n' instead of echo -E would be more portable across different shells and follows shell scripting best practices. Consider changing to: package=$(printf '%s\n' "$release" | jq -r ".assets[].browser_download_url" | grep "linux-arm${bits}.tar.gz")
| package=$(echo -E $release | jq -r ".assets[].browser_download_url" | grep "linux-arm${bits}.tar.gz") | |
| package=$(printf '%s\n' "$release" | jq -r ".assets[].browser_download_url" | grep "linux-arm${bits}.tar.gz") |
|
Learn Build status updates of commit 99d828a: ✅ Validation status: passed
For more details, please refer to the build report. |
PoliCheck Scan ReportThe following report lists PoliCheck issues in PR files. Before you merge the PR, you must fix all severity-1 and severity-2 issues. The AI Review Details column lists suggestions for either removing or replacing the terms. If you find a false positive result, mention it in a PR comment and include this text: #policheck-false-positive. This feedback helps reduce false positives in future scans. ✅ No issues foundMore information about PoliCheckInformation: PoliCheck | Severity Guidance | Term |
|
Learn Build status updates of commit e891d0d: ✅ Validation status: passed
For more details, please refer to the build report. |
mikefrobbins
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
PR Summary
The current installation instructions to install on Raspberry Pi OS fail on
zshbecause thebodyproperty in the response from https://api.github.com/repos/PowerShell/PowerShell/releases/latest has newline characters (\n), and it seems that defaults inzsh(or maybe a setting I forgot I changed, but general point stands) are different frombash, and cause thejqinvocation to fail:Adding
-Etoechoto explicitly disable interpretation of\nmakes the command work in both shells.PR Checklist