#!/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