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*

5
  • Maybe slightly better (because easier to read): if (( array[i] != array[j] )) Commented Dec 21, 2017 at 8:54
  • @user1934428 ah yes. Good call. I'd switched from [ ... ] to [[ ... ]] and forgot that variables can be handled even better with (( ... )). Commented Dec 21, 2017 at 9:24
  • @roaima Backticks are not obsolete (or even deprecated) At best, their usage is not recommended. Commented Dec 21, 2017 at 9:56
  • @fpmurphy1 I have to disagree with you on that point. See unix.stackexchange.com/q/126927/100397 and mywiki.wooledge.org/BashFAQ/082 and the POSIX statement about $(...) being preferred at pubs.opengroup.org/onlinepubs/9699919799/xrat/… Commented Dec 21, 2017 at 14:55
  • @roaima. Good to see that you went to the ONLY authoritative source on the issue, i.e. POSIX. Please explain how the term you used, i..e "obsolete" is equivalent to the term POSIX uses, i.e. "preferred". BTW, neither of the other two sources you quote are authoritative. Commented Dec 22, 2017 at 0:52