#!/bin/sh

#
# cut 
#

# lsd definition at time of writing

#list directories
function lsd
{
   for i in `ls -p | grep /`; do
      echo ${i%/}
   done
}


# lsd produced the following output 
#   (ignore starting # character and leading space)
#   cut acts upon a single character
#   special characters treated with Ctrl-v
#   The 8th column onwards was cut
#   the escape key was a delimeter and the first field was cut -f1

#  ^[[01;34mmisc^[[0m
#  ^[[01;34mopgl^[[0m
#  ^[[01;34mprob^[[0m
#  ^[[01;34mproj^[[0m
#  ^[[01;34mstl^[[0m
#  ^[[01;34mtemp^[[0m

#  bash-2.05a$ lsd | cut -c8- | cut -d^[ -f1
#  mmisc
#  mopgl
#  mprob
#  mproj
#  mstl
#  mtemp

#  Improved directory names(more robust)
#  bash-2.05a$ lsd | cut -d";" -f2 | cut -c4- | cut -d^[ -f1

# ^[ was entered by Ctrl-v ESC carriage return


