Shell: execute commands from stdin if supplied filename is '-'.
Shell: fix potential resource leak, remove unused bit.