Greg Wooledge
2018-06-04 13:12:24 UTC
The problem is that an entry like "/root" will overwrite an exiting entry
or "/root/.cshrc" therefore creating a double entry for "/root" and adding
a new entry for "/root/.cshrc".
Simply rewrite the ENTIRE file. Done.or "/root/.cshrc" therefore creating a double entry for "/root" and adding
a new entry for "/root/.cshrc".
PERMFILE=permissions.local
for VAL in ${ELMT[*]}; do
STOP using all-caps variable names.for VAL in ${ELMT[*]}; do
sed -i
Editing files with a shell script is just fundamentally broken. Don'ttry it. Write the entire new file out.