Last active
November 10, 2015 11:03
-
-
Save termie/e79b79a1328bcb0b4666 to your computer and use it in GitHub Desktop.
WTF: the case of the missing N
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- a/restore_fixtures.sh | |
+++ b/restore_fixtures.sh | |
@@ -65,7 +65,8 @@ restore_to_mongo() { | |
local etcd_key="/services/mongodb" | |
echo "etcd key: $etcd_key" | |
- local host="$(sudo etcdctl ls --recursive $etcd_key | cut -d/ -f4)" | |
+ local host=$(sudo etcdctl ls --recursive "$etcd_key" | cut -d/ -f4) | |
local dump="$work_dir/dump/wercker" | |
# First version results in the command with no "n": | |
# etcd key: /services/mongodb | |
# root : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/bin/etcdctl ls --recursive /services/mo godb | |
# Second version results in: | |
# etcd key: /services/mongodb | |
# root : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/bin/etcdctl ls --recursive /services/mongodb | |
# Now I agree the second version is more correct but... just removing an "n"? What? | |
# I tried removing the --recursive and it still only removed the N so it isn't positional. |
it had the escapes removed by "read" which needed "-r" passed to it to prevent that behavior
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
trying to generate a test case i ran into "IFS=$'\n\t'" which somehow got turned into "IFS=$'nt'" in the output script, so mystery solved BUT AT WHAT COST