Logo
Explore Help
Sign In
gaspersic/ohmyzsh
1
0
Fork 0
You've already forked ohmyzsh
Code Issues Pull Requests Packages Projects Releases Wiki Activity
Files
40016afdc4c4ecdab6092e4f8c5c8648e27e5524
ohmyzsh/plugins/encode64/encode64.plugin.zsh

5 lines
123 B
Bash
Raw Normal View History

Encode64 Plugin - Fix wrong `echo` usage Currently, encode64 plugin using `echo -n` to print the content of $1 variable. This approach will not work with arbitrary data, which contains sequence of escaped characters, since when many `echo` implementation will expand them. This commit chage the usage to `printf`, which is builtin in all POSIX shells and can print arbitrary data reliability.
2015-09-28 16:05:22 +07:00
encode64(){ printf '%s' $1 | base64 }
decode64(){ printf '%s' $1 | base64 --decode }
More usable and shorter aliases
2012-06-14 13:31:00 +03:00
alias e64=encode64
alias d64=decode64
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.4 Page: 196ms Template: 6ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API