#!/bin/sh # usage: ./adj_input_param &key name value fromfile > tofile alles=$(grep -c ".*" $4) ln=0 for n in $(grep -n "$2 " $4 | tr ":" " " | awk '{ print $1; }' | sort -n) do if [ ! "$(head -n$n "$4" | grep "^&" | tail -n1)" == "$1" ] then continue fi tail -n$[$alles - $ln] "$4" | head -n$[$n-$ln-1] ln=$n s=$(grep -n "$2" $4 | grep "^$n:") t=$(echo "$s" | tr "#: " " #" | awk '{ print $2; }') len=${#t} t="#"$(echo "$s" | tr "# " " #" | awk '{ print $2; }' | tr "# " " #") s=$(echo "$s" | tr " =:#" ": " | awk '{print $2 " :'$3'"; }' | tr ": " " =") while [ ${#s} -lt $len ] do s=$s" " done echo "$s$t" ## grep -n "$2" $4 | grep "^$n:" | tr " =:#" ": " | awk '{print $2 " :'$3'" "::#"$4; }' | tr ": " " =" ## grep -n "$2 " $4 | grep "^$n:" | tr " =:" ": " | awk '{ print $2 " :'$3'"; }' | tr ": " " =" ## echo "period_stop = "$[$(grep "prop_stop" $1 | awk '{ print $3; }')-1] done tail -n$[$alles-$ln] "$4"