# --- SDE-COPYRIGHT-NOTE-BEGIN --- # This copyright note is auto-generated by ./scripts/Create-CopyPatch. # # Filename: package/.../sysfiles/functions.in.txt # Copyright (C) 2006 The OpenSDE Project # # More information can be found in the files COPYING and README. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; version 2 of the License. A copy of the # GNU General Public License can be found in the file COPYING. # --- SDE-COPYRIGHT-NOTE-END --- # http://en.wikipedia.org/wiki/ANSI_escape_code # ECHO='echo -e' ESC='\e' # 033 BELL='\a' # 07 ART_SUCCESS=" :-)" ART_FAILURE=" :-(" ART_NEXT=" v " COLOR_TITLE="$ESC[36m" # cyan COLOR_NORMAL="$ESC[0m" # default (no attributes) COLOR_SUCCESS="$ESC[32m" # green COLOR_FAILURE="$ESC[31m" # red MOVE_EOL="$ESC[222G" # 222 columns to the right... kind-of-eol MOVE_UP="$ESC[1A" # 1 line up (eat last \n) # ${#foo} works on bash, dash and pdksh, not on ash MOVE_LEFT_STATUS="$ESC[${#ART_SUCCESS}D" # move left the length of $ART_SUCCESS MOVE_LEFT_NEXT="$ESC[${#ART_NEXT}D" # move left the length of $ART_NEXT title() { local x=1 columns= columns=$( if ! stty size -F /dev/tty; then stty size -F /dev/console fi 2> /dev/null | cut -d' ' -f2 ) [ -n "$columns" ] || columns=80 # fill with dots with an "arrow" pointing down at the end. for (( x=1; x