If you want to open a new xterm and run a sequence of commands in that window, you can use the -e
option. If you want the xterm to remain open after the command is executed, you can include the -hold
option.
For example:
xterm -hold -e 'pwd; ls'
Один awk
один -вкладыш должен выполнить свою работу.
awk '{ printf("%s %s\n", substr(FILENAME, 4, 8), $0); }' FT.*.txt > FT.txt
Я проверил это на приведенных вами примерах. При необходимости отрегулируйте.
Вот простой скрипт, который сделает то, что вам нужно. Он минималистичный, но показывает основные шаги. Предположим, что этот скрипт называется:combine.sh
#!/bin/sh
#Add logic for better parsing of args.
IDENT=$1
SEARCHDIR=$2
# For each file in the Search Directory
# that starts with the Unique Identifier...
for f in "$SEARCHDIR/$IDENT"*; do
datestr=$(echo "$f" | cut -d '.' -f2)
value=$(cat "$f")
echo "$datestr $value"
done
Тогда вы можете просто сделать:
$> combine.sh FT /path/to/my/datadir > FT.txt