Skip to content

Instantly share code, notes, and snippets.

@shubhamkumar13
Created January 6, 2025 12:35
Show Gist options
  • Save shubhamkumar13/9533f8539d310cfaef3e20a9901e7f56 to your computer and use it in GitHub Desktop.
Save shubhamkumar13/9533f8539d310cfaef3e20a9901e7f56 to your computer and use it in GitHub Desktop.
ocaml scripting init template
(* 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