Results for: "to_proc"

-> { it } ^^

foo &&= bar ^^^^^^^^^^^

foo ||= bar ^^^^^^^^^^^

-> { it }
     ^^
foo &&= bar
^^^^^^^^^^^
foo ||= bar
^^^^^^^^^^^

foo.bar += baz ^^^^^^^^^^^^^^^

Foo += bar ^^^^^^^^^^^

foo += baz ^^^^^^^^^^^^^^^

foo.bar += baz
^^^^^^^^^^^^^^^
Foo += bar
^^^^^^^^^^^
foo[bar] += baz
^^^^^^^^^^^^^^^

@@foo += bar ^^^^^^^^^^^^

Foo::Bar += baz ^^^^^^^^^^^^^^^

$foo += bar ^^^^^^^^^^^

@foo += bar ^^^^^^^^^^^

@@foo += bar ^^^^^^^^^^^^

Foo::Bar += baz ^^^^^^^^^^^^^^^

$foo += bar ^^^^^^^^^^^

@foo += bar ^^^^^^^^^^^

@@foo += bar
^^^^^^^^^^^^
Foo::Bar += baz
^^^^^^^^^^^^^^^
$foo += bar
^^^^^^^^^^^
@foo += bar
^^^^^^^^^^^

Replaces the current process by doing one of the following:

This method has potential security vulnerabilities if called with untrusted input; see Command Injection.

The new process is created using the exec system call; it may inherit some of its environment from the calling program (possibly including open file descriptors).

Argument env, if given, is a hash that affects ENV for the new process; see Execution Environment.

Argument options is a hash of options for the new process; see Execution Options.

The first required argument is one of the following:

Argument command_line

String argument command_line is a command line to be passed to a shell; it must begin with a shell reserved word, begin with a special built-in, or contain meta characters:

exec('if true; then echo "Foo"; fi') # Shell reserved word.
exec('exit')                         # Built-in.
exec('date > date.tmp')              # Contains meta character.

The command line may also contain arguments and options for the command:

exec('echo "Foo"')

Output:

Foo

See Execution Shell for details about the shell.

Raises an exception if the new process could not execute.

Argument exe_path

Argument exe_path is one of the following:

Example:

exec('/usr/bin/date')

Output:

Sat Aug 26 09:38:00 AM CDT 2023

Ruby invokes the executable directly. This form does not use the shell; see Arguments args for caveats.

exec('doesnt_exist') # Raises Errno::ENOENT

If one or more args is given, each is an argument or option to be passed to the executable:

exec('echo', 'C*')
exec('echo', 'hello', 'world')

Output:

C*
hello world

Raises an exception if the new process could not execute.

Search took: 4ms  ·  Total Results: 1548