From fdcb2329830662e13a5a93731859d2e4d72a7b9d Mon Sep 17 00:00:00 2001 From: Thomas Forgione Date: Wed, 12 Feb 2020 10:57:39 +0100 Subject: [PATCH] Naive replace-tabs --- bin/replace-tabs | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100755 bin/replace-tabs diff --git a/bin/replace-tabs b/bin/replace-tabs new file mode 100755 index 0000000..051aaf8 --- /dev/null +++ b/bin/replace-tabs @@ -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