Re: sh script & files

2013-02-20 Thread Fbsd8
Polytropon wrote: On Wed, 20 Feb 2013 07:40:08 -0500, Fbsd8 wrote: # 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? The file is closed when the write operation has been fin

Re: sh script & files

2013-02-20 Thread Polytropon
On Wed, 20 Feb 2013 07:40:08 -0500, Fbsd8 wrote: > # 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? The file is closed when the write operation has been finished. Yo

sh script & files

2013-02-20 Thread Fbsd8
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