[LBo] I'm trying to like it ...
T-Rex Ashworth
compnstuff at gmail.com
Thu Jan 25 04:07:07 CET 2007
After moving from Ubuntu to opensuse 10.2, I was missing alot of the
software packages that I had become accustomed too. Luckily, I found smart
package step by steps on suse's wiki and it relates very closely to
automatix2. Now all my multimedia apps work and I get my KDE to boot.
Kubuntu is just to flaky in all versions for my Dell Inspirion 6000.
On 1/24/07, Chris F.A. Johnson <cfajohnson at teksavvy.com> wrote:
>
> On Wed, 24 Jan 2007, Douglas Orchard wrote:
>
> >> ...my newly installed OpenSuSE 10.2, that is. Some things don't exist
> >> in this version that I've come to depend on over the years, such as
> "lc"
> >> and "uc" which do wholesale lowercase and uppercase filename
> >> conversions. These are not installed (duh) and don't exist on the
> >> installation media (downloaded CDs). Other stuff that IS installed
> also
> >> doesn't work:
> >>
> > For uppercase to lowercase try this simple bash script
> >
> > #! /bin/bash
> > #
> > # Changes every filename in working directory to all lowercase.
> > #
> > # Inspired by a script of John Dubois,
> > # which was translated into into Bash by Chet Ramey,
> > # and considerably simplified by Mendel Cooper, author of this document.
> >
> >
> > for filename in * # Traverse all files in directory.
> > do
> > fname=`basename $filename`
>
> There is no need for an external command; bash can do it
> internally:
>
> fname=${filename##*/}
>
> > n=`echo $fname | tr A-Z a-z` # Change name to lowercase.
>
> That will fail if $fname has leading or trailing spaces.
>
> > if [ "$fname" != "$n" ] # Rename only files not already
> lowercase.
> > then
> > mv $fname $n
>
> That will fail if there are any spaces or other pathological
> characters in the filename.
>
> > fi
>
> Rather than run all filenames through an external command, first
> check whether any changes need to be made:
>
> case $filename in
> *[A-Z]*) n=`printf "%s\n" "$fname" | tr A-Z a-z`
> mv -i -- "$fname" "$n"
> ;;
> esac
>
> You can speed up the script even more by using a dynamically
> loadable builtin to change case. See my article at
> <http://www.unixreview.com/documents/s=10089/ur0606a/ur0606a.htm>.
>
> > done
> >
> > exit 0
> >
> > The original author is credited in the comments.
>
> --
> Chris F.A. Johnson <http://cfaj.freeshell.org>
> ===================================================================
> Author:
> Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)
> --
> QnA mailing list - To post: QnA at linuxbasics.org
> Site: http://LinuxBasics.org
> List-options: http://LinuxBasics.org/cgi-bin/mailman/listinfo/qna
>
More information about the QnA
mailing list