added var function to print out variable values.
[feisty_meow.git] / scripts / core / functions.sh
index 903a17d1d9cb4a384ab05be9f5b4acf23f6c7bc1..bc2d1cabf88840ecfa0cb91401eb8e27e083f2de 100644 (file)
@@ -33,17 +33,27 @@ if [ -z "$skip_all" ]; then
     cd "$1"
   }
 
+  # displays the value of a variable in bash friendly format.
+  function var() {
+    local varname="$1"; shift
+    if [ -z "${!varname}" ]; then
+      echo "$varname undefined"
+    else
+      echo "$varname=${!varname}"
+    fi
+  }
+
   function success_sound()
   {
     if [ ! -z "$CLAM_FINISH_SOUND" ]; then
-      play "$CLAM_FINISH_SOUND"
+      bash $FEISTY_MEOW_SCRIPTS/multimedia/sound_play.sh "$CLAM_FINISH_SOUND"
     fi
   }
 
   function error_sound()
   {
     if [ ! -z "$CLAM_ERROR_SOUND" ]; then
-      play "$CLAM_ERROR_SOUND"
+      bash $FEISTY_MEOW_SCRIPTS/multimedia/sound_play.sh "$CLAM_ERROR_SOUND"
     fi
   }
 
@@ -357,6 +367,8 @@ if [ -z "$skip_all" ]; then
     sed -i -e "s%$pattern%$replacement%g" "$file"
   }
 
+  ##############
+
   function function_sentinel() { return 0; }
   
   if [ ! -z "$SHELL_DEBUG" ]; then echo function definitions end....; fi