Warning: main(/www/www/htdocs/style/globals.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/qed_manual/g.html on line 1

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/globals.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/qed_manual/g.html on line 1

Warning: main(/www/www/htdocs/style/header.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/qed_manual/g.html on line 8

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/header.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/qed_manual/g.html on line 8

Global (g)

global

Syntax:

[line_range]g/pattern/more_editor_commands

[line_range]g^/pattern/more_editor_commands

Description:

The Global command checks each line in the indicated line range for the presence of the indicated pattern. The first form (g) marks lines which contain the pattern while the second form (g^) marks lines which do not contain the pattern. The Global command then executes the following commands for each marked line, with the current line set at the marked line before executing. If no line range is specified then all lines are searched for the pattern. For example:

g/^Comment/d

would remove all lines containing the string “Comment” at the beginning of the line. To print them before deleting use:

g/^Comment/pd

To Change all occurrences of the string “minimum” to “maximum” and print the changed lines, issue a:

g/minimum/s//maximum/p

To delete all lines which don't end in the string “.c” issue a:

g^/\.c$/d

To append the line “-------” after each line in the buffer, issue a:

g/^/a  -------

To reverse the order of lines in your buffer, issue a:

g/^/.m0

Finally, to print the lines around each line containing the string “function”, issue a:

g/function/.-5,.+5p

Current line:

When the Global command is finished, the current line has the value it had after the last command executed during the Global operation.

Condition register:

When the Global command is finished, the condition register has the value it had after the last command executed during the Global operation.


Warning: main(/www/www/htdocs/style/footer.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/qed_manual/g.html on line 103

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/footer.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/qed_manual/g.html on line 103