Added two macro examples:

* macro.6.sh - execute selected block
    * macro.7.sh - delete trailing whitespaces

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
This commit is contained in:
Ilia Maslakov 2011-03-06 22:51:04 +00:00 committed by Andrew Borodin
parent bdf5543950
commit bc3c848ab1
3 changed files with 11 additions and 1 deletions

View File

@ -5,7 +5,9 @@ macro_DATA = \
macro.1.sh \
macro.3.sh \
macro.4.sh \
macro.5.sh
macro.5.sh \
macro.6.sh \
macro.7.sh
EXTRA_DIST = \
$(macro_DATA)

4
misc/macros.d/macro.6.sh Normal file
View File

@ -0,0 +1,4 @@
e execute something
TMPFILE=`mktemp ${MC_TMPDIR:-/tmp}/up.XXXXXX` || exit 1
cat %b > $TMPFILE
sh $TMPFILE > %b

4
misc/macros.d/macro.7.sh Normal file
View File

@ -0,0 +1,4 @@
w delete trailing whitespace
TMPFILE=`mktemp ${MC_TMPDIR:-/tmp}/up.XXXXXX` || exit 1
cat %b > $TMPFILE
cat $TMPFILE | sed 's/[ \t]*$//' > %b