From mboxrd@z Thu Jan 1 00:00:00 1970 Message-Id: <200506131257.j5DCvvw28273@zamenhof.cs.utwente.nl> To: 9fans@cse.psu.edu From: Axel Belinfante MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <28267.1118667477.1@zamenhof.cs.utwente.nl.cs.utwente.nl> Date: Mon, 13 Jun 2005 14:57:57 +0200 Cc: sam-fans@hawkwind.utcs.toronto.edu Subject: [9fans] acme/sam internal/external command combination? Topicbox-Message-UUID: 5e7ad5e6-ead0-11e9-9d60-3106f5b1d025 [cross-posting to sam-fans where this is more appropriate, although that has been silent for quite a while] I can count the number of ``a'' characters in ``dot'' (current selection) in acme using Edit x/a/p which prints all ``a'' from ``dot'' in window +Errors and the selecting the aaaa string in +Errors and running >wc on it. Edit x/a/ > wc runs wc for each match of ``a'' which is not what we want (we want to run wc only once, on all matched ``a''). Is there a (more) direct way to do this, or to access the characters printed by the ``p'' command of above ``Edit'', e.g. something to the effect of (Edit x/a/p)| wc (and if so, what would be the sam equivalent?) I could imagine a command sequence that first ``destructs'' dot to contain the aaaaa string and then runs >wc on that, but after that the original contents should be restored, so that is not a very good solution. I think the more general question is: to what extent is it possible (or useful) to mix internal sam/acme commands (in particular those for selecting/matching/looping) with external ones like wc, or is the solution to not try to use acme/sam commands for ``preprocessing'' (selecting), but instead use something external, like sed or awk, on the whole selection? Just trying to learn, Axel.