large the scope of execute a command to enclose many files - Unix

This is a discussion on large the scope of execute a command to enclose many files - Unix ; I need to run that command per every file in the directory ? #dos2unix file1.txt file1.txt...

+ Reply to Thread
Results 1 to 2 of 2

Thread: large the scope of execute a command to enclose many files

  1. large the scope of execute a command to enclose many files

    I need to run that command per every file in the directory ?

    #dos2unix file1.txt file1.txt

  2. Re: large the scope of execute a command to enclose many files

    On 2008-10-27, happytoday wrote:
    > I need to run that command per every file in the directory ?
    >
    > #dos2unix file1.txt file1.txt


    Read the man page.

    If your version of dos2unix supports multiple filenames on the
    command line, use:

    dos2unix *.txt

    If not:

    for file in *.txt
    do
    dos2unix "$file"
    done


    --
    Chris F.A. Johnson, author
    Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)
    ===== My code in this post, if any, assumes the POSIX locale
    ===== and is released under the GNU General Public Licence

+ Reply to Thread