I have a poorly designed build script that always overwrites files that it shouldn't; if I edit these files and then run the script, it overwrites their content and, thus, the build fails.
How can I "lock" these files so that the overwrite fails?
I've tried opening them in editors (vi(m), gedit) but overwrite works regardless?
set -Cto it.set -Conly prevents overwriting by redirection (>). It would not preventgcc a.c -o afrom overwritinga. And the script can overwrite files bymv x a, so that is another thing. All in all, better to give us more details.man - a chmodand use the+i(immutable) flag.