-
Notifications
You must be signed in to change notification settings - Fork 0
/
header
24 lines (19 loc) · 853 Bytes
/
header
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/bash
# Controllo se la directory è stata passata come argomento
if [ "$#" -ne 1 ]; then
echo "Usage: $0 <directory>"
exit 1
fi
directory=$1
# Trova tutti i file con le estensioni specificate e esegui Vim su ciascuno di essi
find "$directory" -type f \( \
-iname "*.c" -o -iname "*.h" -o -iname "*.cc" -o -iname "*.hh" -o -iname "*.cpp" -o -iname "*.hpp" -o -iname "*.php" \
-o -iname "*.htm" -o -iname "*.html" -o -iname "*.xml" \
-o -iname "*.js" \
-o -iname "*.tex" \
-o -iname "*.ml" -o -iname "*.mli" -o -iname "*.mll" -o -iname "*.mly" \
-o -iname "*.vim" -o -iname "*.vimrc" \
-o -iname "*.el" -o -iname "*.emacs" \
-o -iname "*.f90" -o -iname "*.f95" -o -iname "*.f03" -o -iname "*.f" -o -iname "*.for" \
\) -exec vim -c "Stdheader" -c "wq" '{}' \;
echo "Modifica completata su tutti i file."