From 81cece0dc62e1ba9d162ab12ae361b870d74568a Mon Sep 17 00:00:00 2001 From: ZoRo Date: Sat, 27 Jun 2020 18:02:17 +0100 Subject: oecho,omkdir,ormdir,omkfile --- oecho/Makefile | 7 +++++++ oecho/oecho.ml | 10 ++++++++++ oecho/oecho0.ml | 9 +++++++++ 3 files changed, 26 insertions(+) create mode 100644 oecho/Makefile create mode 100644 oecho/oecho.ml create mode 100644 oecho/oecho0.ml (limited to 'oecho') diff --git a/oecho/Makefile b/oecho/Makefile new file mode 100644 index 0000000..d47d838 --- /dev/null +++ b/oecho/Makefile @@ -0,0 +1,7 @@ +make: + ocamlopt oecho.ml -o oecho + ocamlopt oecho0.ml -o oecho0 + +static: + ocamlopt -ccopt -static oecho.ml -o oecho + ocamlopt -ccopt -static oecho0.ml -o oecho0 \ No newline at end of file diff --git a/oecho/oecho.ml b/oecho/oecho.ml new file mode 100644 index 0000000..eae9ffe --- /dev/null +++ b/oecho/oecho.ml @@ -0,0 +1,10 @@ +open Arg +open Unix +open Scanf +open Printf + +let num = Array.length Sys.argv +let _ = if num == 2 then + Printf.printf "%s\n" Sys.argv.(1) + else Printf.printf "\n" + diff --git a/oecho/oecho0.ml b/oecho/oecho0.ml new file mode 100644 index 0000000..fed5a00 --- /dev/null +++ b/oecho/oecho0.ml @@ -0,0 +1,9 @@ +open Arg +open Unix +open Scanf +open Printf + +let num = Array.length Sys.argv +let _ = if num >= 2 then + Printf.printf "%s\n" Sys.argv.(1) + else Printf.printf "\n" -- cgit v1.2.3