zsh-users
 help / color / mirror / code / Atom feed
* Disable most shell expansion to function or script
@ 2024-01-04 18:09 Sam B.
  2024-01-04 18:55 ` Stephane Chazelas
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Sam B. @ 2024-01-04 18:09 UTC (permalink / raw)
  To: zsh-users

[-- Attachment #1: Type: text/plain, Size: 790 bytes --]

Hello,

I'm looking for a way to disable most shell expansion for the arguments 
to a script or function and treat everything up to a newline char as 
verbatim text, i.e. as if quoted.

For example, given a function/script "todo", I'd like

     todo Text inc. $var, *glob?, events!, <redirs, >(sub) & more

to behave more like it was quoted:

     todo 'Text inc. $var, *glob?, events!, <redirs, >(sub) & more'

I know of noglob to disable glob chars, and can have a look at histchars 
to see if events can be disabled. But I'm not sure if any of the other 
expansion can possibly disabled.

Mostly I'm interested joting down some plain text which could include 
'?!&' and have "todo" receive it all without the shell having done some 
magic beforehand.

Any ideas?

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-01-14 23:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-04 18:09 Disable most shell expansion to function or script Sam B.
2024-01-04 18:55 ` Stephane Chazelas
2024-01-04 19:16 ` Mikael Magnusson
2024-01-04 23:38 ` Bart Schaefer
2024-01-05 17:53   ` Sam B.
2024-01-14 23:28     ` Sam B.

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).