#!/bin/bash if (( $# != 1 )); then echo "usage: $0 " exit 1 fi name=$1 file="xml/${name}.xml" if [[ -f $file ]]; then echo "$file already exists. remove it first. then run $0 again." exit 2 fi cat < $file HEREDOC file="xsl/{$name}.xsl" if [[ -f $file ]]; then echo "$file already exists. remove it first. then run $0 again." exit 2 fi cat < $file ]> HEREDOC