shell-quasiquote 
- Description
- Turn s-expressions into shell command strings.
- Latest
- shell-quasiquote-0.0.20250316.162215.tar (.sig), 2025-Mar-16, 10.0 KiB
- Maintainer
- Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
- Website
- https://elpa.gnu.org/packages/shell-quasiquote.html
- Browse ELPA's repository
- CGit or Gitweb
- Badge
To install this package from Emacs, use package-install or list-packages.
Full description
"Shell quasiquote" -- turn s-expressions into POSIX shell command strings.
Shells other than POSIX sh are not supported.
Quoting is automatic and safe against injection.
(let ((file1 "file one")
(file2 "file two"))
(shqq (cp -r ,file1 ,file2 "My Files")))
=> "cp -r 'file one' 'file two' 'My Files'"
You can splice many arguments into place with ,@foo.
(let ((files (list "file one" "file two")))
(shqq (cp -r ,@files "My Files")))
=> "cp -r 'file one' 'file two' 'My Files'"
Note that the quoting disables a variety of shell expansions like ~/foo,
$ENV_VAR, and e.g. {x..y} in GNU Bash.
You can use ,,foo to escape the quoting.
(let ((files "file1 file2"))
(shqq (cp -r ,,files "My Files")))
=> "cp -r file1 file2 'My Files'"
And ,,@foo to splice and escape quoting.
(let* ((arglist '("-x 'foo bar' -y baz"))
(arglist (append arglist '("-z 'qux fux'"))))
(shqq (command ,,@arglist)))
=> "command -x 'foo bar' -y baz -z 'qux fux'"
Neat, eh?
Old versions
| shell-quasiquote-0.0.20250315.115249.tar.lz | 2025-Mar-15 | 2.03 KiB |
| shell-quasiquote-0.0.20221221.82030.tar.lz | 2024-Mar-31 | 2.00 KiB |
| shell-quasiquote-0.0.20201201.221117.tar.lz | 2020-Dec-14 | 1.96 KiB |
| shell-quasiquote-0.0.20201201.171117.tar.lz | 2021-Oct-09 | 1.97 KiB |