I know that when you run “./script.jl foo bar” String[“foo”, “bar”] is passed into the script as a one-dimentional string array. However, this is not what I’m looking for.
I’m looking to process a large text file(up to 1MB), and need STDIN to be exposed in a way that is more like a file. I tried
open(STDIN), however this, as I expected, isn’t proper usage (throws errors).
I’ve written a set of functions which together apply a Git filter for LaTeX documents, however at the time I started writing I didn’t know how I would be passing STDIN into a script so I merely had them read and write to files. Now that the cleaning filter is done, I figure I should make it actually work with Git instead of by opening files and writing to them.
I’m sorry if I’m sound vague. I’ve had over a week to think about this, but the fact of the matter is I’m not use to passing stuff into scripts. Normally I’m reading them from files. I read the documentation on both Strings and Streams, but have no idea how to proceed.
An example of something that Git would accept would be
ruby -e '$stdout.puts $stdin.read.gsub(/ /, "\t")' in a bash script.