Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash -eu
- typeset -g tempfile
- template() {
- local path=$1
- local datetime=$2
- tempfile=$(mktemp -p .)
- cat <<-EOT >${tempfile}
- set terminal png
- set pm3d map
- set output "%d%.png"
- splot "%p%" u 1:2:3 notitle
- EOT
- sed -i -e "s;%d%;${datetime};" -e "s;%p%;${path};" ${tempfile}
- }
- for path in *.txt; do
- datetime=$(head -n 1 ${path} | sed 's/^[^(]*(\([^)]*\)).*$/\1/')
- template ${path} ${datetime}
- gnuplot ${tempfile}
- rm -f ${tempfile}
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement