From 18ace1fbd610396467a41927d12c5b2ce6511b66 Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Sun, 28 Feb 2016 00:42:31 -0500 Subject: eshtrans: Preserve trailing whitespace in input files --- (limited to 'eshtrans') diff --git a/eshtrans/main.esh b/eshtrans/main.esh index 588ca1d..ac3895e 100644 --- a/eshtrans/main.esh +++ b/eshtrans/main.esh @@ -88,10 +88,14 @@ main() fi input="${1}" if [ "x${output}" = 'x-' ]; then - sh_codegen "$(esh_parse "${input}" "$(cat "${input}")")" + contents="$(cat "${input}"; printf '.')" + contents="${contents%.}" + sh_codegen "$(esh_parse "${input}" "${contents}")" else - sh_codegen "$(esh_parse "${input}" \ - "$(cat "${input}")")" >"${output}" + contents="$(cat "${input}"; printf '.')" + contents="${contents%.}" + sh_codegen "$(esh_parse "${input}" "${contents}")" \ + >"${output}" fi fi } -- cgit v0.9.1