fork download
  1. #!/bin/bash
  2.  
  3. function intersect() {
  4. delim=$1
  5. shift;
  6. while [ "$#" -gt 0 ]; do
  7. cat $1;
  8. shift;
  9. echo "$delim"
  10. done
  11. }
  12.  
  13. intersect "==========" <(echo toto) <(ls -Al) prog.sh
Success #stdin #stdout 0s 4424KB
stdin
Standard input is empty
stdout
toto
==========
total 4
-rw-rw-r-- 1 root root 207 Apr  9 13:07 prog.sh
==========
#!/bin/bash

function intersect() {
    delim=$1
    shift;
    while [ "$#" -gt 0 ]; do
        cat $1;
        shift;
        echo "$delim"
    done
}

intersect "==========" <(echo toto) <(ls -Al) prog.sh==========