Next: Replacing Records With recins, Up: Inserting Records [Contents][Index]
Each invocation of recins
adds one record to the targeted
database. The fields comprising the records are specified using pairs
of -f
and -v
command line arguments. For example, this
is how we would add the first entry to a previously empty contacts
database:
$ recins -f Name -v "Mr Foo" -f Email -v [email protected] contacts.rec $ cat contacts.rec Name: Mr. Foo Email: [email protected]
If we invoke recins
again on the same database we will be adding a
second record:
$ recins -f Name -v "Mr Bar" -f Email -v [email protected] contacts.rec $ cat contacts.rec Name: Mr. Foo Email: [email protected] name: Mr. Bar Email: [email protected]
There is no limit on the number of -f
-v
pairs that can
be specified to recins
, other than any limit on command line arguments
which may be imposed by the shell.
The field values provided using -v
are encoded to follow the
rec format conventions, including multi-line field values.
Consider the following example:
$ recins -f Name -v "Mr. Foo" -f Address -v ' Foostrs. 19 Frankfurt am Oder Germany' contacts.rec $ cat contacts.rec Name: Mr. Foo Address: + Foostrs. 19 + Frankfurt am Oder + Germany
It is also possible to provide fields already encoded as rec data for
their addition, using the -r
command line argument. This
argument can be intermixed with -f
-v
.
$ recins -f Name -v "Mr. Foo" -r "Email: [email protected]" contacts.rec $ cat contacts.rec Name: Mr. Foo Email: [email protected]
If the string passed to -r
is not valid rec data then
recins
will complain with an error and the operation will be
aborted.
At this time, it is not possible to add new records containing comments.
Next: Replacing Records With recins, Up: Inserting Records [Contents][Index]