#!/bin/bash # convert chatstandard commands to curfloo cd ~/.curfloo coms="" if [ -f ~/.yahoorc/commands ] then coms=~/.yahoorc/commands else if [ -f ~/.yahoorc/gyach/commands ] then coms=~/.yahoorc/gyach/commands else if [ -f ~/.yahoorc/curphoo/commands ] then coms=~/.yahoorc/curphoo/commands fi fi fi if [ ! -f ${coms} ] then echo "can't find any commands" exit fi cp -av ${coms} ./stdcoms #sed -e 's/::/:/g' gyachcoms |\ #tee newgyachcoms |\ awk 'BEGIN { FS=":" ORS="" } { if (substr($1,1,1) == "#"){ print $0"\n" } else { comname=$1 comboth=substr($0,index($0,$2)) for (subv=9; subv>-1; subv--){ fsubv="\$" subv rsubv="$" subv+1 gsub(fsubv,rsubv,comboth) } lenboth=length(comboth) locsep=index(comboth,"<|>") comright=substr(comboth,locsep+3) lenright=length(comright) lenleft=lenboth-(lenright+3) comleft=substr(comboth,1,lenleft) if (lenright > 1){ print $1":"comright"\n" } else { print $1":"comleft"\n" } } }' stdcoms > newcoms echo "new commands are in ./newcoms"