# is, for better or for worse, an address in sam:

          #n   The empty string after character n; #0 is the beginning
               of the file.

If you're talking about running the script with ^, it's just an
executable. You can put whatever you want in the shebang line; I tend
to use the following:

#!/bin/sed '/^#/d'
# this line is ignored
,x/\*|^ +| +$/d
# this line is also ignored
,x/  +//c/
,x/[‘‘’’“”‘’]/c/"
,x/\\p|\\b/c/\n\n\n
,x/\n\n+/c/\n

Running this as a script outputs only the lines in the file not
beginning with # for interpretation by sam.

To use it with ssam -f, you'd have to use the output rather than the
file directly.

In rc: ssam -f <{script}
In bash: ssam -f <(script)

both send the output to a temporary fd and then return a virtual file
path to that fd for commands like this that expect a file path.

If you really want comments within the sam language itself, the best I
came up with after 5 minutes of thinking was:

x/$^/!#

i.e. run a commented out shell command when an impossible pattern is
matched. The x// is needed to avoid actually launching the shell, and
the !# is needed to avoid interpreting the characters following as
another sam command (even if it's one that would never be run).

- Silas

------------------------------------------
9fans: 9fans
Permalink: 
https://9fans.topicbox.com/groups/9fans/T10b1d559ae7d981e-Mafc9e9d330eaec6c6ad1fe81
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription

Reply via email to