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*

3
  • 1
    Good answer. You may want to mention a couple alternatives to the direct assignment like ((count++)) or simply setting the integer flag on count (e.g. declare -i count=0). Still, it's worth a vote. (also, just a nit, when copying man pages, check for hyphenations (e.g. vari‐ able) to make it read better -- I know they are a pain....) Commented Dec 11, 2015 at 20:31
  • Good suggestions all; I've included both alternatives, fixed hyphenation, and added some more bash(1) excerpts. Commented Dec 11, 2015 at 20:49
  • One question three answers and so good explanation Thanks Dan Lowe it solved my problem and the three solution worked out for me Commented Dec 13, 2015 at 9:45