add shell escape

This commit is contained in:
Yargo-bonox 2019-12-12 12:21:26 +00:00
parent f9e4f65579
commit e9ddeb5f3b
2 changed files with 11 additions and 3 deletions

View File

@ -52,6 +52,8 @@ then also the configuration can be displayed by entering `c`.
- `k` : define target kanban file (for direct edition, and new items)
- `ek` : directly edit the target kanban file with the text editor
- `ec` : directly edit the configuration file with the text editor
- `!` : execute arguments with shell, `/bin/sh -c` by default
(set `myshell` variable in source to `echo` to deactivate this)
In the list above, "N" is a number from the last displayed selection list;
if none is given, the script asks for one. The numbers are not attributed
@ -208,7 +210,7 @@ Just hitting RETURN at the prompt shows the help/usage page:
|<
./clikan.sh : command line kanban
(2019-12-11/HB9KNS)
(2019-12-12/HB9KNS)
configuration file: /home/username/.clikanconf
for help about commands, just hit RETURN
to show configuration, enter 'c'
@ -240,4 +242,4 @@ We want to see the configuration, then quit:
---
*2019-12-11/HB9KNS,Y.Bonetti*
*2019-12-12/HB9KNS,Y.Bonetti*

View File

@ -1,12 +1,13 @@
#!/bin/sh
# clikan.sh -- CLI Kanban
ver='2019-12-11/HB9KNS'
ver='2019-12-12/HB9KNS'
conf="${CLIKANCONF:-$HOME/.clikanconf}"
defkanban="$HOME/clikanban.md"
editor="${CLIKANEDIT:-$VISUAL}"
editor="${editor:-$EDITOR}"
editor="${editor:-ed}"
myshell='/bin/sh -c'
tmpf=`mktemp -t clikanXXXXXX` || tmpf=${TMPDIR:-/tmp}/clikan$$`date +%S%M%d`
: >$tmpf
@ -169,6 +170,7 @@ command keys:
do N: put card N into doing state
ec: directly edit config file -- DANGER!
ek: directly edit kanban file -- DANGER!
!: execute arguments with "$myshell"
EOH
;;
esac
@ -180,6 +182,10 @@ showprompt
while read com coa1 coa2 coa3 coar
do case $com in
q*) break ;;
!) echo
$myshell ${com#!} $coa1 $coa2 $coa3 $coar
echo
echo welcome back ;;
d) showall doing ;;
w) showall waiting/todo/backlog ;;
a) showall archived/done ;;