3 ms·
> why isn't it possible to create and execute a script without saving to a file first It is certainly possible in Bash, at least: CODE='echo Hello; echo Wor
by gbuk2013 12y ago
> why isn't it possible to create and execute a script without saving to a file first
It is certainly possible in Bash, at least:
CODE='echo Hello; echo World'
RESULT=$(bash -c "$CODE")
echo "$RESULT"
Very good article though! :-)
- npsimons 12y agoOther more "obscure" options also come to mind: Emacs Lisp, Smalltalk, etc. Wasn't there also something in Plan 9's GUI like this? The whole saving to a file first thing is just a convention, and one that got me thinking: it's a convention for a reason (reproducibility), and this argument ("why can't I just run it without saving first?"), seems kind of contrary to the whole point of the post. Disks are fast! Saving a file first is ridiculously fast in this day and age. Just bind a keystroke to save and run in one button press. It speaks more to lousy development environments than anything else if you can't make this a one button press operation.