From 5730d3c06045a24b427584b50e62a8d7df8fe7af Mon Sep 17 00:00:00 2001 From: Jacob Babor Date: Sun, 1 Dec 2024 23:21:43 -0600 Subject: [PATCH] Buffer file before modifying it --- wayblue-fix-89.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wayblue-fix-89.sh b/wayblue-fix-89.sh index 2b3013c..ea21ef8 100755 --- a/wayblue-fix-89.sh +++ b/wayblue-fix-89.sh @@ -111,5 +111,7 @@ for file in /etc/shadow /etc/gshadow; do "/^$name:/d" \ "$file" fi - done < "$file" + # Not useless use of cat. We're buffering the file here to avoid conditions + # where we edit the file we're reading and face issues. + done < <(cat "$file") done