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*

8
  • Fantastic code right here! thank you. I don't quite get how to print longer chains of characters. How would I print combinations of 3 or 4 characters? Commented Oct 19, 2016 at 10:10
  • loop over chars again and append to doubles this time, edited Commented Oct 19, 2016 at 10:23
  • I've seen that in the first for loop you can actually write: Commented Oct 19, 2016 at 11:07
  • doubles+=( ${chars[@]/#/$c} ) triplets+=( ${chars[@]/#/$c$c} ) So you don't need new for loops. Last thing is the code prints the output alltogether while I wanted it to be written one combination per line. Any suggestion for this? Commented Oct 19, 2016 at 11:09
  • doubles+=( ${chars[@]/#/$c} ) how does it working, someone explain me.. Commented Oct 19, 2016 at 11:12