This may be a more appropriate question for the CES forums, come to think of it.
# first create a new plugin with all the cells that do not already have the "Illegal_To_Sleep_Here" flag:tes3cmd dump --raw-with-header sleep.esp --type cell --no-match "Flags:.*Illegal_To_Sleep" Morrowind.esm Tribunal.esm Bloodmoon.esm# Step 2, delete all object instances from cells, we just want to retain the cell header stuff:tes3cmd delete --type cell --instance-match . sleep.esp > junk.log# Step 3, delete other stuff from cell header that we don't need, such as ambient lighting settings:tes3cmd delete --sub-match "^(ambient|reference_count|region):" sleep.esp# finally, the perl voodoo to add the Illegal_To_Sleep_Here flag:# (Note, I did this command on Linux, so the quoting for the Windows command line will be different)tes3cmd modify --type cell --run "\$R->set({f=>'flags'},\$R->get('DATA','flags')|\$CELL_FLAGS{illegal_to_sleep_here});" sleep.esp
# first create a new plugin with all the cells that do not already have the "Illegal_To_Sleep_Here" flag:tes3cmd dump --raw-with-header sleep.esp --type cell --no-match "Flags:.*Illegal_To_Sleep" Morrowind.esm Tribunal.esm Bloodmoon.esm# Step 2, delete all object instances from cells, we just want to retain the cell header stuff:tes3cmd delete --type cell --instance-match . sleep.esp > junk.log# Step 3, delete other stuff from cell header that we don't need, such as ambient lighting settings:tes3cmd delete --sub-match "^(ambient|reference_count|region):" sleep.esp# finally, the perl voodoo to add the Illegal_To_Sleep_Here flag:# (Note, I did this command on Linux, so the quoting for the Windows command line will be different)tes3cmd modify --type cell --run "\$R->set({f=>'flags'},\$R->get('DATA','flags')|\$CELL_FLAGS{illegal_to_sleep_here});" sleep.esp