You are not logged in.
Pages: 1
I want to merge many log files (values??.tmp) to one file (values.log):
e.g. cat values1.tmp values2.tmp >> values.log
I made this:
#!/bin/bash
prefix="values"
suffix=".tmp"
cmd="cat"
for i in `seq 1 2`;
do
name=$prefix$i$suffix
cmd=$cmd" "$name
done
cmd=$cmd" >> values.log"
echo $cmd
How to execute $cmd at the prompt as typed?
Offline
I think arithmetic expansion is the easiest way to execute this e.g. your_variable="$( actual_item_here )"
http://ss64.com/bashsyntax/brackets.html
so try changing the last two lines to this:
cmd="$($cmd >> values.log)"
echo $cmd
Offline
Pages: 1