Path: blob/main/scripts/remove-all-windows-carriage-return-characters.sh
901 views
#!/bin/bash12# This file is part of t8code. t8code is a C library to manage a collection (a3# forest) of multiple connected adaptive space-trees of general element classes4# in parallel.5#6# Copyright (C) 2023 Johannes Markert <[email protected]>7#8# t8code is free software; you can redistribute it and/or modify it under the9# terms of the GNU General Public License as published by the Free Software10# Foundation; either version 2 of the License, or (at your option) any later11# version.12#13# t8code is distributed in the hope that it will be useful, but WITHOUT ANY14# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR15# A PARTICULAR PURPOSE. See the GNU General Public License for more details.16#17# You should have received a copy of the GNU General Public License along with18# t8code; if not, write to the Free Software Foundation, Inc., 51 Franklin19# Street, Fifth Floor, Boston, MA 02110-1301, USA.2021# Usage22#23# Search and remove all Windows(TM) carriage return characters '\r' from C/C++24# source files in source code directories. Usually, these25# characters are visible as '^M' characters and are introduced by misconfigured26# source code editors on Windows(TM).2728grep -R -l $'\r' src tutorials example test | xargs -r -l1 perl -i -p -e 's/\r//g'293031