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