Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

2
  • What does the line that starts with [ -r "$file ] mean? Some explanation would be helpful. Commented Jun 29, 2023 at 7:16
  • It could be rewritten "if [ -r "$file" ] ; then source "$file" ; fi". On Unix systems, [ is an alias (often a hardlink) to /bin/test, a program that evaluates its arguments and returns 0 or nonzero in response, which you can then react to in a script using either if or embedded && type logic. It's a style choice, not a functional one. The one who edited my script thus feels it's better to be terse than verbose. You can argue over which is clearer, but both are correct. Commented Jun 29, 2023 at 16:43