We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
exec
let
String
Term
e89a291 resolved #268, but this does not apply to assignments from exec (as of v0.9):
$ echo 'echo -n "mock"' > mock.sh $ chmod +x mock.sh $ saw ┏━━━┓━━━┓━┓━┓━┓ ┃ ━━┓ ╻ ┃ ┃ ┃ ┃ ┣━━ ┃ ╻ ┃┓ ╻ ┏┛ ┗━━━┛━┛━┛┗━┛━┛ version 0.9 sawscript> let mock = exec "./mock.sh" [] "" sawscript> mock [02:47:29.867] "mock" sawscript> print {{ mock }} Cryptol error: [error] at <stdin>:1:10--1:14 Value not in scope: mock sawscript> let mock = "MOCK" sawscript> mock [02:47:38.078] "MOCK" sawscript> print {{ mock }} [02:47:41.325] [77, 79, 67, 75] sawscript> let mock = exec "./mock.sh" [] "" sawscript> mock [02:47:56.305] "mock" sawscript> print {{ mock }} [02:48:00.101] [77, 79, 67, 75]
The text was updated successfully, but these errors were encountered:
One could abuse get_opt instead:
get_opt
$ saw -I $(. mock.sh) sawscript> let mock = get_opt 2 sawscript> print {{ mock }} [12:34:56.789] [109, 111, 99, 107]
Sorry, something went wrong.
I think this has to do with the fact that exec has a result type TopLevel String, so you need to use a bind rather than a let.
TopLevel String
sawscript> mock <- exec "./mock.sh" [] "" sawscript> mock [21:44:08.912] "-n mock\n" sawscript> print {{ mock }} [21:44:13.244] [45, 110, 32, 109, 111, 99, 107, 10]
I'm not sure why I'm getting additional characters here when I do this... but otherwise I think this does what you want.
EDIT: I get what I expect if I force bash via #!/bin/bash in the script.
bash
#!/bin/bash
Thanks! Rookie mistake on my part.
No branches or pull requests
e89a291 resolved #268, but this does not apply to assignments from
exec
(as of v0.9):The text was updated successfully, but these errors were encountered: