-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript
More file actions
21 lines (17 loc) · 694 Bytes
/
script
File metadata and controls
21 lines (17 loc) · 694 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# recurse current directory and subdirectories, replacing dos-style line endings
# with unix-style line endings
# Using git? Git will use the original line endings before this script ran, but in
# your working directory the changes will remain. That means you get to have unix
# file endings, and once you `git add` and `git reset` git will ignore the changes.
currentdir="$(pwd)"
# enable `**` to recurse down directories; without this line, sh turns `**` into `*`
shopt -s globstar
# get files in current directory and from all subdirectories
for f in $currentdir/* $currentdir/**/* ; do
if [[ -d "$f" ]]; then
continue
else
tr -d '\15\32' < "$f" > "$f"1
mv "$f"1 "$f"
fi
done