view combine.sh @ 0:b815081988b5 draft default tip

Uploaded
author nml
date Mon, 06 Feb 2017 10:38:14 -0500
parents
children
line wrap: on
line source

#!/bin/bash

output=$1
shift

i=1

for var in "$@"
do 
	if [[ -s $var ]] ; then
		( head -q -n 1 $var ) > $output
		break
	fi
	i=$[i+1]
done

if [ $i -le "$#" ]
	then
		( tail -q -n +2  $@ )>> $output
else
	exit 5
fi