From 89053e3ed19c816cb103f4ef701e201c8f348ad4 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Sun, 20 May 2018 21:16:19 +0200 Subject: [PATCH] add script --- doc/lib-head+tail | 8 +++++--- script/add_function.sh | 12 ++++++++++++ 2 files changed, 17 insertions(+), 3 deletions(-) create mode 100755 script/add_function.sh diff --git a/doc/lib-head+tail b/doc/lib-head+tail index d3c48f7..597257f 100644 --- a/doc/lib-head+tail +++ b/doc/lib-head+tail @@ -2,10 +2,12 @@ #remaster lib [ -d "" ] || { echo "LIBDIR not exist"; exit 1; } -#beginn func - +# [param] +function () { + #Code of +} #this func is standalone executable [ -n "$1" ] && { - check_user + $@ } diff --git a/script/add_function.sh b/script/add_function.sh new file mode 100755 index 0000000..17bd495 --- /dev/null +++ b/script/add_function.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +#check param +[ -z "$1" ] && { echo "$0 [name]"; exit 1; } +name="$1" + +#gen function +cp "doc/lib-head+tail" "src/func/$name" +sed -i "s//$name/g" "src/func/$name" + +#open +editor "src/func/$name"