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:
Bash
#!/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
Alles anzeigen
How to execute $cmd at the prompt as typed?