4 ms·
What is the `quote` command that example pipes to? Seems handy but unsurprisingly hard to search for.
by ryanianian 5y ago
What is the `quote` command that example pipes to? Seems handy but unsurprisingly hard to search for.
- iudqnolq 5y agoI think it's this? I found it by googling "shell quote command". https://askubuntu.com/questions/354915/quote-command-in-the-shell https://askubuntu.com/questions/354915/quote-command-in-the-...
- virchau13 5y agoAlso note that `printf "%q"` is an alternative to this.
- twp 5y agoIn this example, `quote` is a function from sprig [1] which chemzoi uses with Go's text/template language [2]. [1] https://masterminds.github.io/sprig/strings.html https://masterminds.github.io/sprig/strings.html [2] https://pkg.go.dev/text/template https://pkg.go.dev/text/template