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.

7
  • 10
    @MichałŠrajer, I think you meant colon and not comma ;) Commented Feb 26, 2013 at 8:24
  • 3
    @MichałŠrajer true is part of POSIX.
    – Rufflewind
    Commented Oct 9, 2015 at 5:35
  • 5
    With an old Solaris, with the old bourne shell (not POSIX), I have to write "for last in "$@"; do true; done"
    – mcoolive
    Commented Jan 25, 2016 at 10:47
  • 12
    @mcoolive @LaurenceGolsalves beside being more portable, for last in "$@"; do :; done also makes the intent much clearer. Commented Apr 23, 2018 at 18:59
  • 3
    @mcoolive: it even works in the unix v7 bourne shell from 1979. you can't get more portable if it runs on both v7 sh and POSIX sh :)
    – Dominik R
    Commented Nov 22, 2019 at 10:41