open Sys;; open Unix;; let usage () = prerr_string ("Usage: "^(Filename.basename argv.(0))^" <input_string> <output_string>"); prerr_newline(); exit 1;; let buffer_size = 4096;; let mon_tr () = if Array.length argv <> 3 || String.length argv.(2) = 0 then usage() else begin let tr_char = tr_function argv.(1) argv.(2) in copy_data stdin stdout tr_char end;; handle_unix_error mon_tr ();; |