From: noreply@... Date: 2006-03-18T08:02:43+09:00 Subject: [ ruby-Bugs-3856 ] strange Kernel#exec behavior with bash's source command Bugs item #3856, was opened at 2006-03-17 17:49 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=1698&aid=3856&group_id=426 Category: Core Group: None Status: Open Resolution: None Priority: 3 Submitted By: Rick Hull (nwallins) Assigned to: Nobody (None) Summary: strange Kernel#exec behavior with bash's source command Initial Comment: using ruby 1.8.4 (2005-12-24) [i486-linux] on debian/etch this behavior was informally confirmed by several others in #ruby-lang # the following commands assume a bash prompt, output follows, starting with #> cd ~ echo 'echo success' > test.sh source test.sh #> success ruby -e 'exec "source test.sh"' #> -e:1:in `exec': No such file or directory - source test.sh (Errno::ENOENT) #> from -e:1 ruby -e 'exec "source test.sh;"' #> success ruby -e 'exec "source test.sh > "' #> success # ok, so we need a trailing semicolon or newline # yet, there is still another way ruby -e 'exec "source ~/test.sh"' #> success # aha! maybe it's the presence of the slash? ruby -e 'exec "source ./test.sh"' #> -e:1:in `exec': No such file or directory - source test.sh (Errno::ENOENT) #> from -e:1 # hmm.. WTF? it's not the slash, it's a magic tilde! ----- some discussion in the channel revolved around whether this is a bash or a ruby issue. I have no idea, but I want to point out the strange behavior. Note that 'source' is not a program but a bash command. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=1698&aid=3856&group_id=426