Skip to content
This repository has been archived by the owner on Aug 4, 2022. It is now read-only.

How to test for a command output line that matches the shell pattern? #33

Open
meepyx opened this issue Jan 28, 2019 · 1 comment
Open

Comments

@meepyx
Copy link

meepyx commented Jan 28, 2019

I need to test for a line of command output that starts with "$ ". But this is exactly the pattern that cram uses to run commands in a shell. How do I do it?

Perhaps cram needs to be taught to make an exception for lines starting with two spaces then "$ " and ending with something like "(nocmd)", so it treats them as command output as well rather than trying to run them as shell commands?

@roman-neuhauser
Copy link

Dram (https://git.sr.ht/~rne/dram) provides a workaround, and I intend to make the prompts configurable.

$ printf '$ ugh\n'
[$] ugh (glob)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants