Mail Archives: djgpp/1998/08/31/21:02:12
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/" <win.ini >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
- Raw text -