3 ms·
A practice I've found valuable in the past is the script command. SCRIPT(1) script - make typescript of terminal session Manually run through a process over
by nonrandomstring 4y ago
A practice I've found valuable in the past is the script command.
SCRIPT(1) script - make typescript of terminal session
Manually run through a process over and over, checking the
intermediate outcomes until its right and tight. Then take the last
iteration from script and make that into a shell script. After testing
an tweaking few more times now make that portable in a system language
of your choice. A kludge I frequently used was just copy it to a Perl
file as back-quoted script lines, then replace each with a proper
statement, same thing works with python calling process/system/exec
things that return proper exit values.
Dirty, mechanical, industrial programming. No elegance in sight. But
it works reliably in most cases and leaves an understandable trail for
debug.