Skip to content
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

test: csdiff#170 #371

Closed
wants to merge 2 commits into from
Closed

Conversation

jamacku
Copy link
Member

@jamacku jamacku commented Apr 17, 2024

@@ -4,13 +4,13 @@
# Quoting
# =======

# echo $1 # Unquoted variables
echo $1 # Unquoted variables

Check warning

Code scanning / shellcheck

SC2086 Warning documentation

Double quote to prevent globbing and word splitting.
# rm "~/my file.txt" # Quoted tilde expansion
# v='--verbose="true"'; cmd $v # Literal quotes in variables
# touch $@ # Unquoted $@
# echo 'Path is $PATH' # Variables in single quotes
touch $@ # Unquoted $@

Check failure

Code scanning / shellcheck

SC2068 Error documentation

Double quote array expansions to avoid re-splitting elements.
# touch $@ # Unquoted $@
# echo 'Path is $PATH' # Variables in single quotes
touch $@ # Unquoted $@
echo 'Path is $PATH' # Variables in single quotes

Check warning

Code scanning / shellcheck

SC2016 Warning documentation

Expressions don't expand in single quotes, use double quotes for that.
# trap "echo Took ${SECONDS}s" 0 # Prematurely expanded trap
# unset var[i] # Array index treated as glob
unset var[i] # Array index treated as glob

Check warning

Code scanning / shellcheck

SC2184 Warning documentation

Quote arguments to unset so they're not glob expanded.
@jamacku jamacku marked this pull request as draft April 17, 2024 10:59
@jamacku jamacku linked an issue Apr 19, 2024 that may be closed by this pull request
@jamacku jamacku closed this Apr 29, 2024
@jamacku jamacku deleted the csdiff-170 branch April 29, 2024 08:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Shown alerts should include a possible solution (if available)
1 participant