Lines 606-613
f_sysrc_set()
Link Here
|
606 |
# |
606 |
# |
607 |
# Operate on the matching file, replacing only the last occurrence. |
607 |
# Operate on the matching file, replacing only the last occurrence. |
608 |
# |
608 |
# |
|
|
609 |
# Use 'awk "{print}"' to ensure LF at end of each line, or else |
610 |
# a file without LF at the end would have its last two lines squashed |
611 |
# by 'tail -r'. |
612 |
# |
609 |
local new_contents retval |
613 |
local new_contents retval |
610 |
new_contents=$( tail -r $file 2> /dev/null ) |
614 |
new_contents=$( awk "{print}" "$file" | tail -r 2> /dev/null ) |
611 |
new_contents=$( echo "$new_contents" | awk -v varname="$varname" \ |
615 |
new_contents=$( echo "$new_contents" | awk -v varname="$varname" \ |
612 |
-v new_value="$new_value" "$f_sysrc_set_awk" ) |
616 |
-v new_value="$new_value" "$f_sysrc_set_awk" ) |
613 |
retval=$? |
617 |
retval=$? |