by _c_ · 10y ago · 0 comments
Multiple arguments could be added if you want that. I personally do not need it as I search the cmdline patterns I need without using spaces. I use dots instead. Quick and dirty.
I write 100's of these small scripts for my own use only so I have my own style, peculiar as it may be. I never need indentation because I always keep scripts short; I only use it occasionally and randomly.
I do not use -e with sed, unless I'm using branches or loops.
The execs seem superfluous but actually make a difference, at least on the UNIX I use. Try it with and without and see if you notice.
All my scripts are portable to Bash, but they're also portable to the most basic of Bourne-compatible shells too. I do not use Bash.
Normally I would only add exec to the last command in the script, as djb does. But then I started experimenting with using it after pipes.
If you or anyone can explain why this could make scripts "seem" to execute faster, I would be grateful.
Here's the shell source: ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-release-7/src/bin/sh
Incidentally, have you ever tried execlineb? I use that sometimes too.