Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Here's one example. This is in code my team inherited a long time ago, and there are many more like it.

        databases=`find /var/lib/mysql -type d | sed 's/\/var\/lib\/mysql\///g' | egrep -v 'mysql|test|performance|schema'`


That doesn't do anything with stderr, so it doesn't break.


It does output to STDERR an extra warning.


But that doesn't actually break your script, because backticks only capture stdout.


But it changes the behavior of the script in the UI. It can cause things like cron to send mail. It can cause other things wrapped around the script that are capturing both STDOUT and STDERR from the script to capture extra content. Any tool that's monitoring STDERR and expecting it to be empty may consider that an erroneous run, which may impact other scripted decisions. It's a breaking change in multiple circumstances, even if you don't consider extraneous warnings shown to a user manually running a script a breaking change.

Does that code look like something you'd log into a system and manually run on a regular basis? Does it maybe instead look like one layer of a legacy automation stack absorbed into other tools?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: