That may be the case under Leopard, but for many users of Linux, 'cd'
is a command that is built into the 'bash' shell.
As a result, a call to the command 'cd' using exec wont work. This is
probably one of the reasons that languages such as Ruby include
functions for precisely this operation.
The message
into.rb:1:in `exec': No such file or directory - cd /tmp
(Errno::ENOENT)
is complaining that there is 'No such file or directory' as 'cd'...
not '/tmp'. You can confirm this:
$ cat into.rb
exec "cd"
$ ruby into.rb
into.rb:1:in `exec': No such file or directory - cd (Errno::ENOENT)
from into.rb:1
On 2009-11-12, OZAWA Sakuro <sakuro@2238club.org> wrote:
A very rare use of it is to test if a directory can be chdir-able.
--
Copyright 2009, all wrongs reversed. Peter Seebach / usenet-nospam@seebs.net | Seebs.Net <-- lawsuits, religion, and funny pictures Fair game (Scientology) - Wikipedia <-- get educated!