4 ms·
why in the world would you pipe through grep to select certain lines and then use awk? You could just select lines with awk. The same could be said of cut. If y
by fargle 5y ago
why in the world would you pipe through grep to select certain lines and then use awk? You could just select lines with awk. The same could be said of cut. If you want to use grep and cut that's fine, but using grep and cut with awk implies you are doing it wrong.
Cut for field 1 (`cut -d/` -f1) is a cheesy way of saying we want to delimit fields with '/' too. So add that to awk via script variable or via -F command-line option.
- kbrazil 5y agoIt's probably not the most correct, but it is a very common practice[0]. [0]https://stackoverflow.com/questions/23934425/parse-ifconfig-to-get-only-my-ip-address-using-bash https://stackoverflow.com/questions/23934425/parse-ifconfig-...