News for hackers. Stuff that matters.
Re:Safe ways to do things in bash by freedomben on Monday May 14, 2018 @11:50PM (#17071520)
Haha. Mostly it is dozens, probably hundreds of little things over time when turning to the shell proved highly productive and effective. The shell is surprisingly really, really good at processing text (using the good 'ol unix tools), and it's amazing how often "text processing" type problems come up. Whether you are doing find/replace on source code, looking for where certain strings are used/defined, or curling some page and extracting data out of it, the shell can often provide very quickly and effectively. The bonus feature is that people are often very impressed when you whip out the shell skills and nail something they thought would be difficult.

I also started capturing most tasks as bash functions or aliases in my `~/.bashrc` file. This doubles as both a handy reference for me to look at later to remember how to do something, and automating simple things.

Re:Safe ways to do things in bash by themodelplumber on Tuesday May 15, 2018 @12:44AM (#17071703)
That's really cool, thanks. It seems that whenever I come across an annoying text-processing problem, it's always really hard or too generic-sounding to get search engine help with potential bash solutions. However I'd somehow like to improve in that area.
Re:Safe ways to do things in bash by wool_gather on Tuesday May 15, 2018 @08:39AM (#17073474)
Check out the sed and awk tutorials here: http://www.grymoire.com/Unix/Sed.html

sed in particular is really amazing in what it can do, very simply. (Note, depending on your system, you might want to get GNU sed, for "extended" regex support.)

Those pages do a great job breaking down the basic behavior and explaining pitfalls. They're skim-able, and pretty easily searchable after than, so you can come back and remind yourself of the thing you learned last week.

Re:Safe ways to do things in bash by themodelplumber on Tuesday May 15, 2018 @10:11AM (#17074021)
Thanks!