2 ms·
When writing shell script, try to develop an awareness of how much you use sed, awk, tr, `` and so on to munge the output from one command into the format or va
by gaius 14y ago
When writing shell script, try to develop an awareness of how much you use sed, awk, tr, `` and so on to munge the output from one command into the format or value you want for the next. If it's a lot then something like PowerShell (or equiv on Unix) may be what you're after.
- planckscnst 14y agoI used to do that a lot, but now, I very much try to avoid those for modifying command output - at least for scripts: it can be quite fragile. Usually utilities have options to output exactly what you need instead, or you can get the information another way (another utility, something in /proc, etc).