=== removed file 'functions/fsb_cond_ed' --- functions/fsb_cond_ed 2016-03-05 03:59:47 +0000 +++ functions/fsb_cond_ed 1970-01-01 00:00:00 +0000 @@ -1,21 +0,0 @@ -local target die_msg re edscript -target=$1 -if [[ $2 == '!' ]]; then - shift 2 - re=$1 - edscript=$2$'\nw\n' - die_msg="failed to edit file ${target:t} to not match ${(qqq)re}" - if grep -q $re $target; then - ed -s $target <<<$edscript # || die $die_msg - grep -q $re $target && die $die_msg - fi -else - shift - re=$1 - edscript=$2$'\nw\n' - die_msg="failed to edit file ${target:t} to match ${(qqq)re}" - if ! grep -q $re $target; then - ed -s $target <<<$edscript # || die $die_msg - grep -q $re $target || die $die_msg - fi -fi