#
# Provides functions for checking and sorting the contents of arrays.
+
+#hmmm: these could all be beefed up by properly handling spaces in array
+# entries. use "${blah[@]}" rather than '*' for getting all elems.
+
+
# given the name of an array as the first parameter, this signals
# success (return value zero) if the second parameter is found in the
# array. failure (non-zero return) occurs if the item is missing.
YETI_CORE_SCRIPTS_DIR="$(echo "$ORIGINATING_FOLDER" | tr '\\\\' '/' )"
THIS_TOOL_NAME="$(basename "$0")"
-## check this scripts directory; do we find this script there?
-#pushd "/" &>/dev/null # jump to root so relative paths have to fail.
-#if [ ! -f "$YETI_CORE_SCRIPTS_DIR/$THIS_TOOL_NAME" ]; then
-# echo "This script must be run using its full pathname. This enables the script to"
-# echo "locate the proper folders. Please try again with the full path, e.g.:"
-# echo " bash /home/fred/codeplex/$THIS_TOOL_NAME"
-# exit 1
-#fi
-#popd &>/dev/null
-
# set up the feisty_meow dir.
pushd "$YETI_CORE_SCRIPTS_DIR/../.." &>/dev/null
export FEISTY_MEOW_DIR="$(pwd)"
popd &>/dev/null
-#echo feisty_meow is $FEISTY_MEOW_DIR
export FEISTY_MEOW_SCRIPTS="$FEISTY_MEOW_DIR/scripts"
alias ren='\mv -v -i '
alias up='cd ..'
alias whence=which
-alias xterm='xterm $myxtermflags'
-alias xtroff='xtroff $myxflags'
#hmmm: move these to the custom area?
# Standard CAK aliases that add to or extend Unix commands.
alias why='echo just because.'
# call the generated aliases file, if it exists.
-if [ -f "$FEISTY_MEOW_GENERATED/p_alias.sh" ]; then
+if [ -f "$FEISTY_MEOW_GENERATED/aliases_for_scripts.sh" ]; then
if [ ! -z "$SHELL_DEBUG" ]; then echo launching generated aliases.; fi
- source $FEISTY_MEOW_GENERATED/p_alias.sh
+ source "$FEISTY_MEOW_GENERATED/aliases_for_scripts.sh"
if [ ! -z "$SHELL_DEBUG" ]; then echo done with generated aliases.; fi
fi
##############
system("bash \"$FEISTY_MEOW_SCRIPTS\"/core/unter_alia.sh");
- # generate the first set of alias files; these are the root files used
- # by the shell. each of them will be written to in turn invoke the
- # p_alias files which are made from the set of scripts in FEISTY_MEOW_SCRIPTS
- # (see below).
+ # generate the first set of alias files that are defined in the core
+ # and custom scripts directories.
# trash the old versions.
-unlink("$FEISTY_MEOW_GENERATED/p_alias.sh");
+unlink("$FEISTY_MEOW_GENERATED/aliases_for_scripts.sh");
-printf "writing $FEISTY_MEOW_GENERATED/p_alias.sh...\n";
+printf "writing $FEISTY_MEOW_GENERATED/aliases_for_scripts.sh...\n";
# open the alias files to be created.
-open(she, ">> $FEISTY_MEOW_GENERATED/p_alias.sh");
+open(she, ">> $FEISTY_MEOW_GENERATED/aliases_for_scripts.sh");
#print "os is $OS\n";
##############
-export SHELL_DEBUG=true
+#export SHELL_DEBUG=true
# this variable causes the scripts that listen to it to print more information
# when they run.
if [ ! -z "$SHELL_DEBUG" ]; then
echo the aliases were missing, now they are added...
fi
- source $FEISTY_MEOW_GENERATED/aliases.sh
+ source "$FEISTY_MEOW_GENERATED/core_and_custom_aliases.sh"
fi
# allow connections to our x server from the local host.
# write the aliases for sh and bash scripts.
-GENERATED_ALIAS_FILE="$FEISTY_MEOW_GENERATED/aliases.sh"
+GENERATED_ALIAS_FILE="$FEISTY_MEOW_GENERATED/core_and_custom_aliases.sh"
echo "writing generated aliases in $GENERATED_ALIAS_FILE..."
#hmmm: perhaps a good place for a function to create the header,