I have a small script (called stc) to create a SecureToken with stoken
#!/bin/bash
Read Password
read -p "Password " -s PASS
TOKEN=$(stoken --stdin <<< "$PASS")
xclip -sel c <<< "$TOKEN"
if [[ ! -t 1 ]]; then
echo $TOKEN
fi
In normal circumstances it copies the token to the clipboard. When there is a pipe the token should be written to stdout
(this is working) but for some reason the next command in the pipe is not executed. I think this has to do with the read
but have no idea how to solve this.
For example
$ stc | tee
results in
$ stc | tee
Password <token echo>
<hangs forever>