new fortune.
[feisty_meow.git] / scripts / core / functions.sh
index 6415adbe26faa294b6f843d5be5907bbd52fc271..ed5d19193c1f6eb5c7ecde332161d109f7e1a4c1 100644 (file)
@@ -478,7 +478,11 @@ if [ -z "$skip_all" ]; then
       # we definitely wanted to adjust the case first, rather than doing all
       # the wacky stuff this script does to the filename...  we will capture
       # the output of the replace operaton for reporting.
-      final_name="$(perl "$FEISTY_MEOW_SCRIPTS/files/replace_spaces_with_underscores.sh" "$arg2")"
+      final_name="$(bash "$FEISTY_MEOW_SCRIPTS/files/replace_spaces_with_underscores.sh" "$arg2")"
+      if [ -z "$final_name" ]; then
+        # make sure we report something, if there are no further name changes.
+        final_name="$arg2"
+      fi
       # now zap the intermediate part of the name off.
       final_name="$(echo $final_name | sed -e 's/.*=> //')"
       # printout the combined operation results.
@@ -488,6 +492,48 @@ if [ -z "$skip_all" ]; then
 
   ##############
 
+# new breed of definer functions goes here.  still in progress.
+
+  # defines an alias and remembers that this is a new or modified definition.
+  # if the feisty meow codebase is unloaded, then so are all the aliases that
+  # were defined.
+  function define_yeti_alias()
+  {
+# if alias exists already, save old value for restore,
+# otherwise save null value for restore,
+# have to handle unaliasing if there was no prior value of one
+# we newly defined.
+# add alias name to a list of feisty defined aliases.
+
+#hmmm: first implem, just do the alias and get that working...
+alias "${@}"
+
+
+return 0
+  }
+
+  # defines a variable within the feisty meow environment and remembers that
+  # this is a new or modified definition.  if the feisty meow codebase is
+  # unloaded, then so are all the variables that were defined.
+  # this function always exports the variables it defines.
+  function define_yeti_variable()
+  {
+# if variable exists already, save old value for restore,
+# otherwise save null value for restore,
+# have to handle unsetting if there was no prior value of one
+# we newly defined.
+# add variable name to a list of feisty defined variables.
+
+#hmmm: first implem just sets it up and exports the variable.
+#  i.e., this method always exports.
+export "${@}" 
+
+
+return 0
+  }
+
+  ##############
+
   function function_sentinel() { return 0; }
   
   if [ ! -z "$SHELL_DEBUG" ]; then echo "feisty meow function definitions done."; fi