I made a change in the blogger configuration to ease the later work when blogging. It is possible that older entries are not correctly formatted.

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!