awk

How would I loop over pairs of values without repetition in bash?

我只是一个虾纸丫 提交于 2020-08-26 10:47:26
问题 I'm using a particular program that would require me to examine pairs of variables in a text file by specifying the pairs using indices. For example: gcta --reml-bivar 1 2 --grm test --pheno test.phen --out test Where 1 and 2 would correspond to values from the first two columns in a text file. If I had 50 columns and wanted to examine each pair without repetition (1&2, 2&3, 1&3 ... 50), what would be the best way to automate this by looping through this? So essentially the script would be