Re: [OT] Changing the case of filenames

From: Paul Howarth (paul_at_city-fan.org)
Date: 04/29/05

  • Next message: Nigel Wade: "Re: FC3 install hangs "reading package info""
    Date: Fri, 29 Apr 2005 14:45:05 +0100
    To: For users of Fedora Core releases <fedora-list@redhat.com>
    
    

    David Niemi wrote:
    > I am running a fortran program which requires all input file names to be
    > uppercase. As things were originally done in Windo$e all the filenames
    > are mixed case (with numbers).
    >
    > Searching around I came across the "tr" command, but my difficulty comes
    > in trying to use this from the command line (or even in a bash script).
    >
    > mv * | tr [a-z] [A-Z]
    >
    > Does not work as mv requires a directory for the objective with multiple
    > files. All of the scripts that I have seen are mainly for changing the
    > case of text in a text file so wouldn't work for me.
    >
    > So, how would I do this?

    You could use a script like this one:

    #!/bin/sh
    for f in *
    do
             F="`echo $f | tr a-z A-Z`"
             echo Renaming \"$f\" to \"$F\"
            mv "$f" "$F"
    done

    That would rename all files in the current directory where you run it from.

    Paul.

    -- 
    fedora-list mailing list
    fedora-list@redhat.com
    To unsubscribe: http://www.redhat.com/mailman/listinfo/fedora-list
    

  • Next message: Nigel Wade: "Re: FC3 install hangs "reading package info""

    Relevant Pages

    • Re: [OT] Changing the case of filenames
      ... > I am running a fortran program which requires all input file names to be ... > uppercase. ... As things were originally done in Windo$e all the filenames ...
      (Fedora)
    • Re: [OT] Changing the case of filenames
      ... > I am running a fortran program which requires all input file names to be ... > uppercase. ... > in trying to use this from the command line (or even in a bash script). ...
      (Fedora)
    • Re: [OT] Changing the case of filenames
      ... >>I am running a fortran program which requires all input file names to be ... >>uppercase. ... >>in trying to use this from the command line (or even in a bash script). ...
      (Fedora)
    • Re: Really Baffled any clues as to what is going on?
      ... > I am working on a script, it has an input file of machine names. ... > Dim fstrLogFilePath ... > fstrInputFile = InputBox("Enter name of file containing machines to ...
      (microsoft.public.scripting.vbscript)
    • Re: Parse an input file using a Key value
      ... I have an input file in the following format getting repeated. ... I tried to achieve this task using the following script below but it is ... To tranpose certain rows into columns and sort by one of the ...
      (comp.unix.shell)