Changeset 4235 for dynamico_lmdz/simple_physics/bash/beautify.sh
- Timestamp:
- Jan 21, 2020, 12:54:37 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
dynamico_lmdz/simple_physics/bash/beautify.sh
r4233 r4235 1 1 #!/bin/bash 2 3 # NOTE : sed -i seems to work differently on GNU and OSX systems 4 # a temporary file is used instead 5 6 TMP=$(mktemp) 7 2 8 for x in $* ; do 3 9 # indent source file using emacs in batch mode … … 5 11 emacs -batch $x --eval '(f90-mode)' --eval '(indent-region (point-min) (point-max) nil)' --eval '(delete-trailing-whitespace)' -f save-buffer 2>/dev/null 6 12 # remove blank lines at end of file 7 sed -i '' -e :a -e '/^\n*$/{$d;N;};/\n$/ba' $x 13 sed -e :a -e '/^\n*$/{$d;N;};/\n$/ba' $x > $TMP 14 cp -f $TMP $x 8 15 done 16 17 rm -f $TMP
Note: See TracChangeset
for help on using the changeset viewer.