fi
echo
echo "it is $(date +"%A at %H:%M hours on day %e of the %B moon in the gregorian year %Y" | tr A-Z a-z) and our intrepid adventurer $USER is exploring a computer named $(hostname) that is running in a thoughtspace called $osname $osver (code-name $codename), and $USER has deduced that the machine's OS platform is $(uname -m) and its current incarnation has been ${up}." | $splitter
-#hmmm: splitter not accepting these args properly right now:
-#--mincol 2 --maxcol 40
echo
-#echo '++++++++++++++++++++++++++++++++++++++++++'
-#echo
echo "the following things appear to be lying around here..."
echo
ls -hFC $color_add
echo
-#echo '++++++++++++++++++++++++++++++++++++++++++'
-#echo
echo "there appear to be these entities on this host..."
echo
who -suT
function print_instructions()
{
echo -e "\n$(basename $0 .sh):\n"
+
+#hmmm: extract to a terminal size function.
+# calculate the number of columsn in the terminal.
+cols=$(stty size | awk '{print $2}')
+
echo -e 'this script takes two parameters, a "here" folder and a "there" folder, almost as if it were a copy command. but instead, this removes any file from under the "here" location if it cannot be found in the "there" location. so the "there" location is considered a more definitive template of what should be in "here", such that we strip out what "there" does not have.\n\n
-the most" useful way to use this script is for a "here" hierarchy that is a copy of an older version of another "there" hierarchy. the "there" hierarchy may have changed a lot, including new files, changed files, and deleted files. it is a simple operation to copy everything from "there" into "here" (such as by using the command [ cp -R "$there"/* "$here" ] ) , but it is a lot harder to determine what stuff in "here" is out of date and should be removed. that is where this script comes in; it can be run to flush out any older things in "here", rather than requiring the user to manually find all those files. ' | splitter
+the most" useful way to use this script is for a "here" hierarchy that is a copy of an older version of another "there" hierarchy. the "there" hierarchy may have changed a lot, including new files, changed files, and deleted files. it is a simple operation to copy everything from "there" into "here" (such as by using the command [ cp -R "$there"/* "$here" ] ) , but it is a lot harder to determine what stuff in "here" is out of date and should be removed. that is where this script comes in; it can be run to flush out any older things in "here", rather than requiring the user to manually find all those files. ' | splitter --maxcol $(($cols - 1))
echo
echo "Example Usage:"
echo
# use our splitter tool for lengthy output if it's available.
if [ ! -z "$(which splitter)" ]; then
TO_SPLITTER="$(which splitter)"
+
+#hmmm: another reusable chunk here, getting terminal size.
+ # calculate the number of columsn in the terminal.
+ cols=$(stty size | awk '{print $2}')
+ TO_SPLITTER+=" --maxcol $(($cols - 1))"
else
TO_SPLITTER=cat
fi