file renamed and posix fixed

This commit is contained in:
mrdotx 2021-07-27 09:41:57 +02:00
parent 3d43617afc
commit 3c70964009
No known key found for this signature in database
GPG Key ID: 433F70E636E6EB87
2 changed files with 36 additions and 43 deletions

43
test
View File

@ -1,43 +0,0 @@
#!/bin/sh
if [[ $1 -eq 1 ]]; then
echo "SETTITLE title
SETPROMPT prompt
SETDESC PROMPT
GETPIN
BYE" | ./pinentry-dmenu
elif [[ $1 -eq 2 ]]; then
echo "SETTITLE title
SETPROMPT confirm
SETDESC CONFIRM
confirm
BYE" | ./pinentry-dmenu
elif [[ $1 -eq 3 ]]; then
echo "SETTITLE title
SETPROMPT prompt
SETDESC REPEAT
SETREPEAT repeat
GETPIN
BYE" | ./pinentry-dmenu
else
echo "SETTITLE title
SETPROMPT prompt
SETDESC PROMPT
GETPIN
SETPROMPT confirm
SETDESC CONFIRM
confirm
SETPROMPT repeat
SETDESC REPEAT
SETREPEAT
GETPIN
BYE" | ./pinentry-dmenu
fi

36
test.sh Executable file
View File

@ -0,0 +1,36 @@
#!/bin/sh
prompt="SETTITLE title
SETPROMPT prompt
SETDESC PROMPT
GETPIN"
confirm="SETTITLE title
SETPROMPT confirm
SETDESC CONFIRM
confirm"
repeat="SETTITLE title
SETPROMPT prompt
SETDESC REPEAT
SETREPEAT repeat
GETPIN"
case $1 in
1)
printf "%s\nBYE" "$prompt" \
| ./pinentry-dmenu
;;
2)
printf "%s\nBYE" "$confirm" \
| ./pinentry-dmenu
;;
3)
printf "%s\nBYE" "$repeat" \
| ./pinentry-dmenu
;;
*)
printf "%s\n%s\n%s\nBYE" "$prompt" "$confirm" "$repeat" \
| ./pinentry-dmenu
;;
esac