Ignore:
Timestamp:
Jan 21, 2020, 12:54:37 AM (5 years ago)
Author:
dubos
Message:

simple_physics : DYNAMICO driver

File:
1 edited

Legend:

Unmodified
Added
Removed
  • dynamico_lmdz/simple_physics/bash/beautify.sh

    r4233 r4235  
    11#!/bin/bash
     2
     3# NOTE : sed -i seems to work differently on GNU and OSX systems
     4# a temporary file is used instead
     5
     6TMP=$(mktemp)
     7
    28for x in $* ; do
    39    # indent source file using emacs in batch mode
     
    511    emacs -batch $x --eval '(f90-mode)' --eval '(indent-region (point-min) (point-max) nil)' --eval '(delete-trailing-whitespace)' -f save-buffer 2>/dev/null
    612    # 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
    815done
     16
     17rm -f $TMP
Note: See TracChangeset for help on using the changeset viewer.