- # this removes any trailing newline in the var, so we add it back on,
- # because we want a consistent ending to match
- local file_content
- if $readsudo; then
- file_content="$(sudo cat "$file")
-"
- else
- file_content="$(<"$file")
-"
- fi
+ # command substitution removes any trailing newlines, so we have to add
+ # a non-newline ending, we randomly chose "b", then remove it.
+ content=$($readsudo cat "$file"; echo b) content=${content%b}
+