I have a bash for loop that looks like this:
for entry in ~/properties/*
do
PROP=$(basename "$entry")
echo $PROP
my_converter $entry -o $OPATH$PROP.vcl --tf --tf-file=$OPATH$PROP.tf
done
This does most of what I need. I set the OPATH variable before the loop and create a new file with the same name and append a different file extension.
What's missing is to write the output generated by running my_converter
into another file with the same name but with a file extension of .info
.
Some things I've tried (based on this question):
my_converter $entry -o $OPATH$PROP.vcl --tf --tf-file=$OPATH$PROP.tf >> $OPATH$PROP.info
and creating a new file descriptor with the .info
file as the target:
...
do
exec 3>$entry.info
PROP=$(basename "$entry")
echo $PROP
my_converter $entry -o $OPATH$PROP.vcl --tf --tf-file=$OPATH$PROP.tf 1>3
...
And for completeness, I've also tried just doing a regular redirect:
my_converter $entry -o $OPATH$PROP.vcl --tf --tf-file=$OPATH$PROP.tf > $OPATH$PROP.info
I know there's some redirect voodoo I can do to get this working. Any help greatly appreciated.