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.

9
  • Use bash -x scriptname to debug. Commented Dec 8, 2014 at 11:51
  • 3
    There are 2 mistakes. The line should be x=$(($x + 1)). But easy to use seq instead all script seq 50 Commented Dec 8, 2014 at 11:52
  • 3
    Just so you know, in bash, you can do echo {1..50}. And in $(()) environment, the variables inside are automatically evaluated, which is why you don't need the $ inside it again. Commented Dec 8, 2014 at 11:55
  • 1
    Thanks, @muru I started 10 mins back. thinking of doing it in normal way first. Commented Dec 8, 2014 at 11:57
  • 1
    @WannaBeCoder you are using let and could also just do ((x++)). Also look up the let command. Commented Dec 8, 2014 at 12:01