Advertisement
metalx1000

combine lines from a file into array

Jun 3rd, 2016
652
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.14 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. list=($(cat list.txt))
  4.  
  5. for var in "${list[@]}"
  6. do
  7.   for var2 in "${list[@]}"
  8.   do
  9.     echo "${var}-${var2}"
  10.   done
  11. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement