Sep 29, 2011 Cartesian products in bash? sstagg Uncategorized bash, cartesian, fish, shell, snippet 0 Comment Given a directory with 2 sub-directories, A and B, this snippet will output: quartz ~/>; ls A B quartz ~/> ls -d1 */../*/ | sed ‘s;/../;->;g;s;/;;g’ A->A A->B B->A B->B