6 ms·
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
by cestith 4y ago
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'`
- TillE 4y agoThat doesn't do anything with stderr, so it doesn't break.
- cestith 4y agoIt does output to STDERR an extra warning.
- int_19h 4y agoBut that doesn't actually break your script, because backticks only capture stdout.
- cestith 4y agoBut 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?
- deleted 4y ago[deleted]