#!/bin/bash
# Reads from one file all lines
# takes the first word as the name of a new file
# creates the new file with that name
# adds text out of a file before and after
output='/path/to/output/dir'
input='/path/to/input/file.txt'
prefix='/path/to/input/start.txt'
sufix='/path/to/input/end.txt'
cd $output
awk '{print "" > $0".java"}' $input
for i in $( ls ); do
cat $prefix >> $i
done
awk '{print $0 >> $0".java"}' $input
for i in $( ls ); do
cat $sufix >> $i
done