Pages

Wednesday, 27 June 2012

sed HERE documents and bash

I tried to create a small template and replace the value of the variable using sed. Here is the following code:

#! /usr/bin/bash


TEXT= cat << 'TEXTEND' #! /usr/bin/bash



CLASSPATH=



for a in #{LIBRARY}/*.jar ;
do
CLASSPATH="${CLASSPATH};$a"
done
echo $CLASSPATH
java -cp $CLASSPATH

TEXTEND

TEXT=`cat $TEXT |sed -e 's/#{LIBRARY}/lib/'|cat `

echo $TEXT



This code does not work correctly yet!