-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreplaceTabs
More file actions
executable file
·27 lines (22 loc) · 834 Bytes
/
replaceTabs
File metadata and controls
executable file
·27 lines (22 loc) · 834 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/bash
## -------------------------------------------------------------------
## Git Repo Checker 1.0.0
##
## This is free software: you are free to change and redistribute it.
## There is NO WARRANTY, to the extent permitted by law.
## -------------------------------------------------------------------
### Replaces tabs with spaces in the given files.
### Usage: replaceTabs [options] <file>...
###
### -h, --help Show help options.
### -v, --version Print program version.
help=$(grep "^### " "$0" | cut -c 5-)
version=$(grep "^## " "$0" | cut -c 4-)
eval "$(docopts -A args -h "$help" -V "$version" : "$@")"
. $(dirname $0)/scriptsConfig
for (( i = 0; i < ${args[<file>,#]}; i++ )); do
FILE=${args[<file>,$i]}
cp $FILE $FILE.tmp
expand -t $TABNUM $FILE.tmp > $FILE
rm $FILE.tmp
done