Sender: nate AT cartsys DOT com Message-ID: <35EB394C.703981CD@cartsys.com> Date: Mon, 31 Aug 1998 17:01:16 -0700 From: Nate Eldredge MIME-Version: 1.0 To: "John M. Aldrich" CC: djgpp AT delorie DOT com Subject: Re: Game loop References: <6s2mth$c70$1 AT towncrier DOT cc DOT monash DOT edu DOT au> <35E73645 DOT B77D2CE5 AT cs DOT net> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Precedence: bulk John M. Aldrich wrote: > There is also gettimeofday(), whose fields have > a microsecond resolution. Though not necessarily a microsecond *precision*-- beware! -- Nate Eldredge nate AT cartsys DOT com mp > > And change it to another filename... But since "filename.bmp" could be > anything, how do I search for this string? Basically, I'd need to search > for "Wallpaper=" and then change the entire line to something else. A tool already exists that can do this; it's called `sed'. It's a little complicated, but probably something like this will work: sed "s/^Wallpaper=.*/New Contents Of Line/" new-win.ini This translates as: Read contents of `win.ini', replace occurences of ["Wallpaper=" at the beginning of a line followed by anything] with "New Contents of Line", and write the result to `new-win.ini', which you can then rename over `win.ini'. Those who do not understand `sed' are doomed to reinvent it. (--Some poster whose name I've forgotten) -- Nate Eldredge nate AT cartsys DOT com