Naive replace-tabs

This commit is contained in:
Thomas Forgione 2020-02-12 10:57:39 +01:00
parent e00f179ca7
commit fdcb232983
1 changed files with 12 additions and 0 deletions

12
bin/replace-tabs Executable file
View File

@ -0,0 +1,12 @@
#!/usr/bin/env bash
# Replaces the tabs by spaces in the current directory.
for file in *; do
file $file | grep text 2>&1 > /dev/null
if [ $? -eq 0 ]; then
# It is a text file, perform the replace
sed -i 's/\t/ /g' $file
fi
done