I do not believe this is true permutations, as I do not want a combination of IDs duplicated in a different order.
I have a lists of 1 to x IDs:
List #1: 1001 1002 1003 1004
List #2: 1002 1004 1005
List #3: 1001 1003 1006
List #4: 1002 1003 1005 1006 1007 1008 1010
etc.
Keeping in mind the lists are variable in length, I need a way to get all possible combinations of the IDs in a list (but not the same combination in a different order).
For instance, List #1 would return:
1001
1002
1003
1004
1001 1002
1001 1003
1001 1004
1002 1003
1002 1004
1003 1004
1001 1002 1003
1001 1002 1004
1001 1003 1004
1002 1003 1004
1001 1002 1003 1004
List #2 would return:
1002
1004
1005
1002 1004
1002 1005
1004 1005
1002 1004 1005
I need the solution to work in a bash script. In all fairness, I could call Python, PHP, etc.
Any input is greatly appreciated.