あなたはlist x
が保存されてい方法に応じて、あなたは、単に一緒にすべての3つのリストを置換するためにブレース展開を使用することができ、例えば:
printf "%s\n" {Mike,Tom,Harry,Steve}\
{Deborah,Sarah,Jennifer}\
{Alex,Joe,Kelly,Amanda,Will,Phillip,David}
使用例/出力
$ bash brexpperm.sh
MikeDeborahAlex
MikeDeborahJoe
MikeDeborahKelly
MikeDeborahAmanda
MikeDeborahWill
MikeDeborahPhillip
MikeDeborahDavid
MikeSarahAlex
MikeSarahJoe
MikeSarahKelly
MikeSarahAmanda
MikeSarahWill
MikeSarahPhillip
MikeSarahDavid
MikeJenniferAlex
MikeJenniferJoe
MikeJenniferKelly
MikeJenniferAmanda
MikeJenniferWill
MikeJenniferPhillip
MikeJenniferDavid
TomDeborahAlex
TomDeborahJoe
TomDeborahKelly
TomDeborahAmanda
TomDeborahWill
TomDeborahPhillip
TomDeborahDavid
TomSarahAlex
TomSarahJoe
TomSarahKelly
TomSarahAmanda
TomSarahWill
TomSarahPhillip
TomSarahDavid
TomJenniferAlex
TomJenniferJoe
TomJenniferKelly
TomJenniferAmanda
TomJenniferWill
TomJenniferPhillip
TomJenniferDavid
HarryDeborahAlex
HarryDeborahJoe
HarryDeborahKelly
HarryDeborahAmanda
HarryDeborahWill
HarryDeborahPhillip
HarryDeborahDavid
HarrySarahAlex
HarrySarahJoe
HarrySarahKelly
HarrySarahAmanda
HarrySarahWill
HarrySarahPhillip
HarrySarahDavid
HarryJenniferAlex
HarryJenniferJoe
HarryJenniferKelly
HarryJenniferAmanda
HarryJenniferWill
HarryJenniferPhillip
HarryJenniferDavid
SteveDeborahAlex
SteveDeborahJoe
SteveDeborahKelly
SteveDeborahAmanda
SteveDeborahWill
SteveDeborahPhillip
SteveDeborahDavid
SteveSarahAlex
SteveSarahJoe
SteveSarahKelly
SteveSarahAmanda
SteveSarahWill
SteveSarahPhillip
SteveSarahDavid
SteveJenniferAlex
SteveJenniferJoe
SteveJenniferKelly
SteveJenniferAmanda
SteveJenniferWill
SteveJenniferPhillip
SteveJenniferDavid
それとも、あなたがスペースを必要とする場合、あなたは単に拡張に1を追加することができます
printf "%s\n" {'Mike ','Tom ','Harry ','Steve '}\
{'Deborah ','Sarah ','Jennifer '}\
{Alex,Joe,Kelly,Amanda,Will,Phillip,David}
使用例/出力
$ bash brexpperm.sh
Mike Deborah Alex
Mike Deborah Joe
Mike Deborah Kelly
Mike Deborah Amanda
...
Steve Jennifer Amanda
Steve Jennifer Will
Steve Jennifer Phillip
Steve Jennifer David
あなたがコントロールの上に持っていない場合あなた自身のスクリプト内のリストであれば、ループ解がうまく動作します。
何を試しましたか?あなたはどんなエラーを出していますか?リストはどこに保存されていますか? –