1 2 3 4 5
#!/usr/bin/env bash arr=($*) for i in ${!arr[@]};do echo ${arr[$i]} ${arr[$i+1]} done | grep ' '