#!/bin/bash # convert curfloo commands to curphoo format cd ~/.curphoo if [ ! -f ~/.curfloo/commands ] then exit fi cp -avf ~/.curfloo/commands ./floocoms sed -e 's/::/:/g' -e 's/\$[0-9*]/%s/g' floocoms |\ tee sedcoms |\ awk 'BEGIN { FS=":" ORS="" } { if (substr($1,1,1) =="#"){ print $0"\n" } else { noncom=0 if (substr($2,1,1) != "!"){ print ":" } else { print "!" noncom=1 if (substr($2,2,1) == "!"){ print "!" noncom=2 } } print $1"\n"substr($0, (index($0,$2)+noncom),length($0)-(length($1)+1))"\n\n" } }' > newcoms if [ ! -f ./commands.org ] then cp -av ./commands ./commands.org fi cat ./commands.org ./newcoms > ./commands