From 227c5f821fcd410227f3c5e21d62f5b7c3ccc62d Mon Sep 17 00:00:00 2001 From: Sviatoslav Abakumov Date: Fri, 9 Jun 2017 12:39:00 +0300 Subject: [PATCH] Use sed with an intermediary file --- fisher.fish | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fisher.fish b/fisher.fish index 1711d4c..7c8dcef 100644 --- a/fisher.fish +++ b/fisher.fish @@ -1492,7 +1492,9 @@ function __fisher_key_bindings_remove -a plugin_name fish_indent < "$user_key_bindings" | command sed -n "/### $plugin_name ###/,/### $plugin_name ###/{s/^ *bind /bind -e /p;};" | builtin source ^ /dev/null - command sed --follow-symlinks -i "/### $plugin_name ###/,/### $plugin_name ###/d" "$user_key_bindings" + command sed "/### $plugin_name ###/,/### $plugin_name ###/d" < "$user_key_bindings" > "$user_key_bindings.$tmp" + command cat "$user_key_bindings.$tmp" > "$user_key_bindings" + command rm "$user_key_bindings.$tmp" if command awk ' /^$/ { next }