Skip to content

Comment on Show HN: Tap curl in your editor before it gets to sh

Comments

Why do you create an env variable that contains the whole file in question when the editor returned success? Wouldn't something like:

  cat "$f"; rm "$f"
not involve loading the whole file in memory at once? Note that using this also makes sense with self-extracting archives/shell scripts, because it lets you inspect the shell script at the beginning.

Moreover, dumping the file into a variable doesn't seem to be a good idea if the file were to contain null characters.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.