recins can also be used to replace existing records in a database with a provided record. This is done by specifying some criteria selecting the record (or records) to be replaced.
Consider for example the following command applied to our contacts database:
$ recins -e "Email = 'email@example.com'" -f Name -v "Mr. Foo" -f Email -v \ "firstname.lastname@example.org" contacts.rec
The contact featuring an email
email@example.com gets replaced with
the following record:
Name: Mr. Foo Email: firstname.lastname@example.org
The records to be replaced can also be specified by index, or by a range of indexes. For example, the following command replaces the first, second and third records in a database with dummy records:
$ recins -n 0,1-2 -f Dummy -v XXX foo.rec $ cat foo.rec Dummy: XXX Dummy: XXX Dummy: XXX ... Other records ...