3 ms·
I mean, whatever works for you, obviously - there's no true way - but this sounds fragile - and perhaps more importantly - like working against the grain of she
by e12e 6y ago
I mean, whatever works for you, obviously - there's no true way - but this sounds fragile - and perhaps more importantly - like working against the grain of shell/Unix.
I would generally say that state belongs in environment variables (and arguments) - and/or files/input streams. Not partially hard-coded in partial scripts.
I suppose I could see a "framework" like:
./projX/setup
./projX/job1
./projX/job2
./projX/cleanup
But I'd still prefer setup and friends to accept a path (not PATH) as first argument or whatever. Rather than assuming a relative path.
Maybe even factor most of this into something that could live under /opt/bin or whatever.
Especially for cron I'd rather see:
/opt/projX/scripts/mangle /opt/projX
Rather than just the first part with an implicit argument of "parent of containing folder".