From: Ian Kelling Date: Mon, 11 Nov 2024 00:20:49 +0000 (-0500) Subject: fix: use sudo when needed X-Git-Url: https://iankelling.org/git/?a=commitdiff_plain;p=cedit fix: use sudo when needed --- diff --git a/cedit b/cedit index 9e0b831..0a6c0fe 100755 --- a/cedit +++ b/cedit @@ -95,14 +95,14 @@ section. cedit is short for config edit. local tailn=1 local temp="$(mktemp -d)/$file_name" cp "$file" "$temp" - cp /dev/null "$file" + $s cp /dev/null "$file" while IFS= read -r line; do tailn=$(( tailn + 1 )) if [[ $line == "$begin" ]]; then in_section=true; break fi - printf '%s\n' "$line" >> $file + printf '%s\n' "$line" | tee -a $file >/dev/null done < "$temp" fi