#!/bin/bash # convert curfloo commands to standard #cd ~/.curfloo if [ ! -f ~/.curfloo/commands ] then exit fi cp -av ~/.curfloo/commands ./floocoms #sed -e 's/::/:/g' floocoms |\ awk 'BEGIN { FS=":" ORS="" } { regex="\$[\*0-9]" if (substr($1,1,1) == "#"){ print $0"\n" } else { cmd=substr($0,index($0,$2)) for (subv=1; subv<10; subv++){ fsubv="\$" subv rsubv="$" subv-1 gsub(fsubv,rsubv,cmd) } cmd_l=cmd if (match($0,regex)) { gsub(regex,"",cmd_l) print $1":"cmd_l"<|>"cmd"\n" } else { print $1":"cmd"<|>\n" } } }' floocoms > coms_standard echo "New commands are in ./coms_standard"