cls(){ tput clear cd tty } u(){ cd .. } d() { if [ "$BASH" ] && [ "$BASH" != "/bin/sh" ]; then echo "$FUNCNAME: ksh only";return 1 fi FIGNORE= # ksh93 equivalent to bash shopt -s dotglob if [ ${#} -gt 0 ] ;then # Only one command line argument accepted cd -- "$1" && return 0 fi if [ `ls -AF1|grep /|wc -l` -eq 1 ] ;then # cd if only one subdirectory cd -- `ls -AF1|grep /` && return 0 fi destdir=$( while :; do subdirs=( ~(N)*/ ) # ksh93 equivalent to subdirs=( */ ) with shopt -s nullglob (( ${#subdirs[@]} > 2 )) || break # . and .. are two entries echo -e "\n\t\tSubdirectories below ${PWD}: \n" >&2 for idx in "${!subdirs[@]}"; do printf '%d) %q\n' "$idx" "${subdirs[$idx]%/}" >&2 done printf '\nSelect a subdirectory: ' >&2 read -r if [[ $REPLY ]]; then cd -- "${subdirs[$REPLY]}" || break # Continue to loop through subdirectories after cding else break fi done printf '%s\n' "$PWD" ) [[ $destdir ]] && cd -- "$destdir" && return 0 } f(){ echo -e "You have these functions in your environment:\n" typeset +f echo } alias rm="rm -i" alias cp="cp -i" alias mv="mv -i" alias ls="ls --color" alias date="/bin/date '+%_A, %B %-d, %Y %H%M %Z'"