From: nobu@... Date: 2006-08-01T22:46:42+09:00 Subject: Re: Default shell for Kernel::system() ? Hi, At Tue, 1 Aug 2006 17:20:25 +0900, Ronald Fischer wrote in [ruby-talk:205370]: > Ist it possible to kind of define a default shell which will be used > for Kernel::system? I often need to invoke from my Ruby scripts /bin/sh is hardcoded, like as make, cron and so on. > external commands, involving redirection and globbing, for example > (bash syntax) > > foo [a-z]* 2>&- Closing descriptor should work on all variants of Bourne shell, including UNIX Seventh Edition's. http://www.freebsd.org/cgi/man.cgi?query=sh&apropos=0&sektion=0&manpath=Unix+Seventh+Edition&format=html Input output. <&- The standard input is closed. Similarly for the standard output using >. If one of the above is preceded by a digit then the file descriptor created is that specified by the digit (instead of the default 0 or 1). For example, ... 2>&1 creates file descriptor 2 to be a duplicate of file descriptor 1. > bar << def bash(cmd) system("bash", "--norc", "-c", cmd) > end -- Nobu Nakada