4 ms·
A coworker of mine would write all his bash scripts to echo out the commands it would run, and then to actually run it he would pipe it to bash. This way he cou
by PureParadigm 6y ago
A coworker of mine would write all his bash scripts to echo out the commands it would run, and then to actually run it he would pipe it to bash. This way he could inspect the commands to make sure they were correct before running them.
Something like: ./dangerous-script.sh $args | bash
- jacobwilliamroy 6y agoI also do this.
- meesterdude 6y agowow that's so clever and simple! Love it.
- deleted 6y ago[deleted]
- tomjakubowski 6y agoIs your coworker Willard Van Orman Quine?
- GauntletWizard 6y agoI would love a shell that allows you to “run” a script in manual mode - Where at the end of every command, every statement, it prints what the next command will be with all variables expanded or otherwise called out, and then requires you to hit “enter” to cause it to proceed. I write a decent amount something between README and Shell Script. I’ve already got an awk one-liner that parses the shell out of Markdown. I typically copy+paste, line-by-line, from my README and add a bunch of echo statements to verify what i’m doing.
- efreak 6y agoPress f8 to process autoexec?
- dredmorbius 6y agoSame, or save to a file, temporarily, check that, then run the resulting script.