remaster/script/add_function.sh

13 lines
214 B
Bash
Raw Normal View History

2018-05-20 19:16:19 +00:00
#!/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/<function>/$name/g" "src/func/$name"
#open
editor "src/func/$name"