Linux command
recset 命令
文件
复制后可按需替换文件名、目录或参数。
常用示例
Update field value
recset -f [Field] -v "[new_value]" -e "[condition]" [file.rec]
Set field in all records
recset -f [Status] -v "[active]" [file.rec]
Update specific type
recset -t [Type] -f [Field] -v "[value]" -e "[condition]" [file.rec]
Add field if missing
recset -a -f [NewField] -v "[value]" [file.rec]
说明
recset modifies field values in GNU recutils plain-text database files, updating existing fields or adding new ones based on selection expressions. It uses the same expression syntax as recsel to target specific records, then sets the specified field to a new value. The -a flag adds the field only to records where it does not already exist, and -n limits updates to the first N matching records. Without a selection expression, all records in the file are updated. The file is modified in place. Part of the GNU recutils toolkit.
参数
- -t, --type _type_
- Record type.
- -f, --field _name_
- Field to set.
- -v, --value _value_
- New value.
- -e, --expression _expr_
- Selection expression.
- -a, --add
- Add field if missing.
- -n, --num _n_
- Update first n matches.
FAQ
What is the recset command used for?
recset modifies field values in GNU recutils plain-text database files, updating existing fields or adding new ones based on selection expressions. It uses the same expression syntax as recsel to target specific records, then sets the specified field to a new value. The -a flag adds the field only to records where it does not already exist, and -n limits updates to the first N matching records. Without a selection expression, all records in the file are updated. The file is modified in place. Part of the GNU recutils toolkit.
How do I run a basic recset example?
Run `recset -f [Field] -v "[new_value]" -e "[condition]" [file.rec]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -t, --type _type_ do in recset?
Record type.