diff options
author | Nobuyoshi Nakada <[email protected]> | 2024-03-01 02:27:56 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <[email protected]> | 2024-03-01 13:11:29 +0900 |
commit | 5baee82c766308294d21e8167af43dc01346eb76 (patch) | |
tree | 5d94ab4dac17c662a713d7fb588669aea3eeca71 | |
parent | 1a9a20cebda38994d1df1d8394206cac587098eb (diff) |
[DOC] Mention about executable file and fallback to sh
-rw-r--r-- | process.c | 15 |
1 files changed, 14 insertions, 1 deletions
@@ -8865,7 +8865,7 @@ proc_warmup(VALUE _) * * Argument +exe_path+ is one of the following: * - * - The string path to an executable to be called: + * - The string path to an executable file to be called: * * Example: * @@ -8881,6 +8881,19 @@ proc_warmup(VALUE _) * escape the entire command name using a shell in platform * dependent manner, or use the array form below. * + * If +exe_path+ does not contain any path separator, an executable + * file is searched from directories specified with the +PATH+ + * environment variable. What the word "executable" means here is + * depending on platforms. + * + * Even if the file considered "executable", its content may not be + * in proper executable format. In that case, Ruby tries to run it + * by using <tt>/bin/sh</tt> on a Unix-like system, like system(3) + * does. + * + * File.write('shell_command', 'echo $SHELL', perm: 0o755) + * system('./shell_command') # prints "/bin/sh" or something. + * * - A 2-element array containing the path to an executable * and the string to be used as the name of the executing process: * |