fork download
  1. #!/bin/bash
  2.  
  3. f(){
  4. printf -vv %$2s
  5. eval echo ${v// /$1}
  6. }
  7.  
  8. for testcase in "{0,1} 2" "{0,1} 5" "{1,0} 2"; do
  9. f $testcase
  10. done
Success #stdin #stdout 0s 5092KB
stdin
Standard input is empty
stdout
00 01 10 11
00000 00001 00010 00011 00100 00101 00110 00111 01000 01001 01010 01011 01100 01101 01110 01111 10000 10001 10010 10011 10100 10101 10110 10111 11000 11001 11010 11011 11100 11101 11110 11111
11 10 01 00