From 6d35fd2d3cc6840234e75202a08392c6807c23ff Mon Sep 17 00:00:00 2001 From: Ian Kelling Date: Sun, 10 Nov 2024 19:20:49 -0500 Subject: [PATCH] fix: use sudo when needed --- cedit | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 -- 2.30.2