Created
January 6, 2025 12:35
-
-
Save shubhamkumar13/9533f8539d310cfaef3e20a9901e7f56 to your computer and use it in GitHub Desktop.
ocaml scripting init template
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(* shebang for ocaml *) | |
#!/usr/bin/env ocaml | |
(* to access files in the opam switch for the script *) | |
#use "topfind";; | |
#require "bos";; | |
let _ = | |
Bos.OS.Cmd.run_out @@ Bos.Cmd.v "ls" | |
|> Bos.OS.Cmd.out_string | |
|> function | |
| Ok (s, _) -> print_endline s | |
| Error (_) -> raise @@ Failure "fail" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment