}
shell_replace() {
+
+ local usage="Usage: shell_replace [-i[.BACKUP_EXTENSION]] [-find PAHT]"
+ if [ -z "$*" -o "$1" = "--help" -o "$1" = "-h" ]; then
+ echo "$usage"
+ return
+ fi
+
+ if [ "$1" = "-find" ]; then
+ shift
+ grep -ErlI '^.{1,3}<SHELL_REPLACE' ${@:?$usage}
+ return
+ fi
+
perl -ne '
if (/^(\s*).{1,3}>SHELL_REPLACE (.*)$/ .. /^\s*.{1,3}<SHELL_REPLACE.*/){
$ch = 1;
require_once(realpath(dirname(__FILE__).'/init.php'));
if (!isset($Db)) global $Db, $Table;
$Db->pdef('format',$Db->content_type2format());
-#$Db->pdef('action','db.ls');
-#bye(nb::P('action'));
return $Db->action($Db->p('action'),$Table);
?>
#cp -a "$tmp/" /Users/nico/Downloads/commit/
rm -rf "$tmp"
+(
+
+export DBQ_PARAMS="db=nb-sys"
+
for f in $(grep -ErlI '^.{1,3}<SHELL_REPLACE' $NB_ROOT); do
echo "Update $f" | sed "s; $NB_ROOT/; ;"
shell_replace -i.shell_replace "$f"
done
+
+)