Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 Feb 2013 07:40:08 -0500
From:      Fbsd8 <fbsd8@a1poweruser.com>
To:        FreeBSD questions <questions@freebsd.org>
Subject:   sh script & files
Message-ID:  <5124C428.1080909@a1poweruser.com>

next in thread | raw e-mail | index | archive | help
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

file="/usr/local/etc/filename"

# 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?

Thanks



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5124C428.1080909>