mayaculpa / hapi

Hydro­ponic Automa­tion Plat­form Ini­tia­tive (HAPI)
GNU General Public License v3.0
68 stars 21 forks source link

communicator.py: Trim trailing whitespace. #98

Closed james-prior closed 7 years ago

james-prior commented 7 years ago

Easy merge.

PedroSFreitas commented 7 years ago

Thanks, James.

james-prior commented 7 years ago

Hi @PedroSFreitas,

Unix is a tool builder's culture. Think of Lego bricks. Explore how the following bricks are combined.

grep -r '  *$' *
grep -rl '  *$' *
vi -o `grep -rl '  *$' *`  ;# <Esc>:qa to get out of vi
find * -name '*.py' -print
find * -name '*.py' -exec grep '  *$' {} \;
find * -name '*.py' -exec grep -l '  *$' {} \;
find * -name '*.py' -exec grep -l '  *$' {} \; | while read f; do t=`mktemp`; echo sed -e 's/  *$//' "$f" "$t";echo mv -f "$t" "$f";done
find * -name '*.py' -exec grep -l '  *$' {} \; | while read f; do t=`mktemp`; sed -e 's/  *$//' <"$f" >"$t";mv -f "$t" "$f";done
PedroSFreitas commented 7 years ago

Unix is a tool builder's culture.

Not sure, but I believe I read a similar definition of Unix on K&R. Or maybe on another book.

james-prior commented 7 years ago

@PedroSFreitas wrote:

Not sure, but I believe I read a similar definition of Unix on K&R. Or maybe on another book.

The two following books are excellent.

I do not know if any of the above books say "Unix is a tool builder's culture", but they sure live it.