mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-03-20 03:13:33 +01:00
Adding support for stdin input in the encode64 plugin
This commit is contained in:
parent
75b9030f48
commit
b9cc8248d4
1 changed files with 15 additions and 2 deletions
|
|
@ -1,4 +1,17 @@
|
||||||
encode64(){ echo -n $1 | base64 }
|
encode64(){
|
||||||
decode64(){ echo -n $1 | base64 --decode }
|
if [ $# -eq 0 ]; then
|
||||||
|
cat | base64
|
||||||
|
else
|
||||||
|
echo -n "$*" | base64
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
decode64(){
|
||||||
|
if [ $# -eq 0 ]; then
|
||||||
|
cat | base64 --decode
|
||||||
|
else
|
||||||
|
echo -n "$*" | base64 --decode
|
||||||
|
fi
|
||||||
|
}
|
||||||
alias e64=encode64
|
alias e64=encode64
|
||||||
alias d64=decode64
|
alias d64=decode64
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue