"Fossies" - the Fresh Open Source Software Archive

Member "tmv-1.1.3/bin/tmv-ul.sh" (19 Jul 2005, 813 Bytes) of package /linux/privat/old/tmv-1.1.3.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 #!/bin/sh
    2 #
    3 # copyright 2003-2005 Gene Pavlovsky <heilong@bluebottle.com>
    4 #
    5 # this is free software; you can redistribute it and/or modify
    6 # it under the terms of the GNU General Public License as published by
    7 # the Free Software Foundation; either version 2 of the License, or
    8 # (at your option) any later version.
    9 #
   10 # tmv-ul: lower-case and underscore all files in path(s).
   11 
   12 while test $# -gt 0 -a "${1:0:1}" = '-' -a "$1" != '--'; do
   13   test -z "$options" && options="$1" || options="$options $1"
   14   shift
   15 done
   16 test "$1" = '--' && shift
   17 
   18 if test $# -lt 1; then
   19   echo "Usage: $(basename $0) [tmv options] path [path]*" >&2
   20   echo
   21   echo "Rename all files in path(s) to lower-case, changing spaces to underscores." >&2
   22   exit 1
   23 fi
   24 
   25 find "$@" -depth | tmv -l -e 'y/ /_/' -e 's/_\{2,\}/_/g' -e 's/_-_/-/g' $options