Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
DLR-AMR
GitHub Repository: DLR-AMR/t8code
Path: blob/main/scripts/remove-all-windows-carriage-return-characters.sh
901 views
1
#!/bin/bash
2
3
# This file is part of t8code. t8code is a C library to manage a collection (a
4
# forest) of multiple connected adaptive space-trees of general element classes
5
# in parallel.
6
#
7
# Copyright (C) 2023 Johannes Markert <[email protected]>
8
#
9
# t8code is free software; you can redistribute it and/or modify it under the
10
# terms of the GNU General Public License as published by the Free Software
11
# Foundation; either version 2 of the License, or (at your option) any later
12
# version.
13
#
14
# t8code is distributed in the hope that it will be useful, but WITHOUT ANY
15
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
16
# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
17
#
18
# You should have received a copy of the GNU General Public License along with
19
# t8code; if not, write to the Free Software Foundation, Inc., 51 Franklin
20
# Street, Fifth Floor, Boston, MA 02110-1301, USA.
21
22
# Usage
23
#
24
# Search and remove all Windows(TM) carriage return characters '\r' from C/C++
25
# source files in source code directories. Usually, these
26
# characters are visible as '^M' characters and are introduced by misconfigured
27
# source code editors on Windows(TM).
28
29
grep -R -l $'\r' src tutorials example test | xargs -r -l1 perl -i -p -e 's/\r//g'
30
31