comparison combine.sh @ 0:b815081988b5 draft default tip

Uploaded
author nml
date Mon, 06 Feb 2017 10:38:14 -0500
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:b815081988b5
1 #!/bin/bash
2
3 output=$1
4 shift
5
6 i=1
7
8 for var in "$@"
9 do
10 if [[ -s $var ]] ; then
11 ( head -q -n 1 $var ) > $output
12 break
13 fi
14 i=$[i+1]
15 done
16
17 if [ $i -le "$#" ]
18 then
19 ( tail -q -n +2 $@ )>> $output
20 else
21 exit 5
22 fi
23
24