shellquote

package
v0.13.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 8, 2026 License: MIT Imports: 1 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package shellquote is the one POSIX-shell quoting primitive: the form a command abcd prints, or writes into a script, takes so a value reaches the shell as one literal word whatever it holds.

Before it, five packages each spelled the same one-liner (the dev shim's paths and the status line in internal/core/ahoy, the orphan remedy in internal/core/capture, a lab harvest's capture line in internal/core/lab, the connect guide's command in internal/core/oracle, and one worktree's repair in internal/abcdhome); TestOnlySingleQuotesForTheShell holds every other package to this one.

It is a leaf that imports only the standard library, outside internal/core, so internal/abcdhome, which is documented to import nothing else, can use it.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Single

func Single(s string) string

Single is s as one single-quoted POSIX shell word, the quotes included. Inside single quotes a shell interprets nothing, not `$`, a backquote, a backslash or, in an interactive bash or zsh, `!word` history, so the one character that needs spelling is the quote itself: close, escaped quote, reopen, which is the four bytes

'\''

The empty string is the empty word, two quotes with nothing between. (The escape's spelling sits in a code block because gofmt rewrites a doubled apostrophe in doc-comment prose to a typographic quote.)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL