Skip to content

Conversation

@hyperupcall
Copy link
Collaborator

This mainly fixes the following:

  • Not only are more path-related variables quoted (ie. git-touch, git-scp), but variables like $BRANCH are.
  • Add more -r to read invocations
  • Stuff like $(echo $(printf '%s\n' 'thing')) is changed to $(printf '%s\n' 'thing')

}

while [[ $# > 0 ]]
while [[ $# -gt 0 ]]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this changed? > is be perfectly and expressive find within [[ ... ]], isn't it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

> and < perform lexicographical comparison rather than a numerical comparison in this context, so it was changed to -gt

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. Thx for the explanation. With this new knowledge I now have to have a look at some of my own scripts as well :)

@spacewander spacewander merged commit 4611b24 into tj:master Jan 20, 2023
@hyperupcall hyperupcall deleted the bash-fixes-2 branch January 21, 2023 00:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants