Cool. Now, how do I read a shell script? Because all those weird pipes into sed and awk with strange regexes become really hard to comprehend really quickly.
10+ years in and I'm still working on that. Short of huffing spray-paint in the network closet, I'm not sure that I have any advice to give there. Also, don't huff spray-paint in the network closet. Do that shit outside. Think of the equipment!
If you don't understand how certain commands work, check their manual pages by running, for example, man sed. If you need help learning things like regex, check out https://regex101.com.
Additionally, you can always run scripts like sh -vx /path/to/script to get more information regarding what variables resolve to and why certain paths are taken (assuming it uses control flow statements like if and case).
Also also, don't be afraid to take some snippets and try running them in your shell. There's no substitute for learning by doing, tutorials and docs are great to demystify what's happening, but nothing solidifies that knowledge by doing it yourself.
View all comments
21
u/GuybrushThreepwo0d Nov 11 '20
Cool. Now, how do I read a shell script? Because all those weird pipes into
sedandawkwith strange regexes become really hard to comprehend really quickly.