sh script & files

Fbsd8 fbsd8 at
Wed Feb 20 12:40:14 UTC 2013

I noticed that when power fails I loose the contents of some files I am 
using in a sh script.

I read and write the file this way


# read file
. "${file}"

# write to file
 > "${file}"

I'm thinking the file is never closed so on power failure I loose the 
contents of the file.

How would I code a command to close the file?


More information about the freebsd-questions mailing list