Home Reference HScript commands 

opchange hscript command

Search and replace text in parameter values.

Usages

  1. opchange [-t type_pattern] [-T network_type] [-n name_pattern] [-N fullpath_pattern] [-p path] [-s] [-i] from_string to_string

Searches all parameters of operators matching the given criteria for from_string. If found, it is replaced with the to_string.

Options

-t type_pattern

Changes operators whose type matches type_pattern.

-T network

Changes operators of network_type (see optype for information on network types).

-n name_pattern

Changes operators with names matching name_pattern.

-N fullpath_pattern

Changes operators with full paths matching fullpath_pattern.

-p path

Start searching from this path in the operator hierarchy. If you don’t specify a path, the search begins at the root (/).

-s

(Silent) Do not print the list of changes.

-i

Normally, from_string only matches whole words (for example, string “myobj” would not match value “myobj1”. You can use the -i flag to make the string match word substrings.

Examples

opchange plastic constant
Would change the word plastic to the word constant wherever it is found.

opchange -n geo* plastic constant
Find all operators whose name begins with geo, changing the word plastic to the word constant.

opchange -t light plastic constant
Find all operators of type light, changing the word plastic to the word constant.

opchange -T SHOP plastic constant
Find all SHOPs, changing the word plastic to the word constant.

opchange -p /obj plastic constant
Find all operators under /obj, changing the word plastic to the word constant.