I am trying to run the following as part of a application start script:
for file in $TEMPLATE_FOLDER/*
do
filename='basename $file'
echo "Processing $filename"
if [ -f "$CONF_FOLDER/$filename" ]
then
echo "Using existing $filename"
else
echo "Creating $filename from template $file"
cp $file $CONF_FOLDER
fi
done
But the output is:
Processing basename $file
Creating basename $file from template ../conf/templates/conf-TEST/log4j.xml
The basename command is not evaluated and is just printed out.
When i run the command from the prompt it works fine.
Bash version:
bash -version
GNU bash, version 3.00.16(1)-release (sparc-sun-solaris2.10)
Copyright (C) 2004 Free Software Foundation, Inc.
Can anyone see what i am doing wrong?
Thanks!