The output of seek is used by the replace and append programs to write new rows and by lock and unlock to set and remove row locks.
$ cat inventory Item Amount Cost Value Description ---- ------ ---- ----- -------------- 1 3 50 150 rubber gloves 2 100 5 500 test tubes 3 5 80 400 clamps 4 23 19 437 plates 5 99 24 2376 cleaning cloth 6 89 147 13083 bunsen burners 7 5 175 875 scales$ echo 5 | seek -mb inventory Item 207 245 0 8
The numbers mean that the row is 207 bytes from the beginning of the file and that it ends at byte 245 (making it 38 bytes long).
The following commands extract a row, blank it out, and then write it back into the inventory in the same place as the original row.
$ LOCATION=`echo 5 | seek -mb -o tmp inventory Item` $ cat tmp Item Amount Cost Value Description ---- ------ ---- ----- -------------- 5 99 24 2376 cleaning clothSEE ALSO$ blank < tmp | replace inventory $LOCATION $ cat inventory Item Amount Cost Value Description ---- ------ ---- ----- -------------- 1 3 50 150 rubber gloves 2 100 5 500 test tubes 3 5 80 400 clamps 4 23 19 437 plates 6 89 147 13083 bunsen burners 7 5 175 875 scales