File indexing completed on 2025-03-16 03:58:26

0001 # ===========================================================
0002 #
0003 # This file is a part of digiKam project
0004 # https://www.digikam.org
0005 #
0006 # Date        : 2011-11-02
0007 # Description : simple BASH script to check EOL of each file from LibRaw
0008 #               which can use CRLF and must be converted to LF for KDE git.
0009 #
0010 # Copyright (C) 2011-2024 by Gilles Caulier <caulier dot gilles at gmail dot com>
0011 #
0012 # This program is free software; you can redistribute it
0013 # and/or modify it under the terms of the GNU General
0014 # Public License as published by the Free Software Foundation;
0015 # either version 2, or (at your option)
0016 # any later version.
0017 #
0018 # This program is distributed in the hope that it will be useful,
0019 # but WITHOUT ANY WARRANTY; without even the implied warranty of
0020 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
0021 # GNU General Public License for more details.
0022 #
0023 # ============================================================
0024 
0025 #!/bin/bash
0026 
0027 for f in `find . -iname \*`; do
0028     if file $f | grep "CRLF"
0029     then
0030         echo "Patched EOL of file: $f"
0031         tr -d '\15\32' < $f > $f.tr
0032         mv $f.tr $f
0033     fi
0034 done