From bc3c848ab10e4ea7556536ad8c095d0c86c3af6d Mon Sep 17 00:00:00 2001 From: Ilia Maslakov Date: Sun, 6 Mar 2011 22:51:04 +0000 Subject: [PATCH] Added two macro examples: * macro.6.sh - execute selected block * macro.7.sh - delete trailing whitespaces Signed-off-by: Ilia Maslakov --- misc/macros.d/Makefile.am | 4 +++- misc/macros.d/macro.6.sh | 4 ++++ misc/macros.d/macro.7.sh | 4 ++++ 3 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 misc/macros.d/macro.6.sh create mode 100644 misc/macros.d/macro.7.sh diff --git a/misc/macros.d/Makefile.am b/misc/macros.d/Makefile.am index 18594b7dd..07144179c 100644 --- a/misc/macros.d/Makefile.am +++ b/misc/macros.d/Makefile.am @@ -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) diff --git a/misc/macros.d/macro.6.sh b/misc/macros.d/macro.6.sh new file mode 100644 index 000000000..fed113a1f --- /dev/null +++ b/misc/macros.d/macro.6.sh @@ -0,0 +1,4 @@ +e execute something + TMPFILE=`mktemp ${MC_TMPDIR:-/tmp}/up.XXXXXX` || exit 1 + cat %b > $TMPFILE + sh $TMPFILE > %b diff --git a/misc/macros.d/macro.7.sh b/misc/macros.d/macro.7.sh new file mode 100644 index 000000000..e0b8c2471 --- /dev/null +++ b/misc/macros.d/macro.7.sh @@ -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 -- 2.11.4.GIT