From hs568 @ cornell.edu Thu Apr 29 10:49:52 2010 From: hs568 @ cornell.edu (Haruo Suzuki) Date: Wed, 28 Apr 2010 21:49:52 -0400 Subject: [Glang-devel] =?iso-2022-jp?b?GyRCJWolQCUkJWwlLyVIGyhCJz4mJw==?= =?iso-2022-jp?b?GyRCJEclKCVpITwbKEI=?= Message-ID: <3C2A0F53-BFAF-4FC6-97D6-865DE82B04BD@cornell.edu> g-language-1.8.11/lib/Rcmd.pm 157行目 . $this->{cmd} . " >& " . $this->{log}); を . $this->{cmd} . " > " . $this->{log} . " 2>&1"); に変更願います。 > explanations here: > https://wiki.ubuntu.com/DashAsBinSh > > I think there is a bug somewhere in Rcmd.pm, which does not > support POSIX Shell, like line 156: > > system("/usr/bin/env R " . $this->{save} . " --slave < " > . $this->{cmd} . " >& " . $this->{log}); > > should be > > system("/usr/bin/env R " . $this->{save} . " --slave < " > . $this->{cmd} . " > " . $this->{log} . " 2>&1"); > > There might be other places like that. >>> ■'>&'でエラー >>> Ubuntu LinuxサーバでRcmd.pmを使用したところ、 >>> sh: Syntax error: Bad fd number >>> というエラーが出力されたので、とりあえず >>> Rcmd.pmの162行目 >>> . $this->{cmd} . " >& " . $this->{log}); >>> のリダイレクトを'>'に変更してエラーを回避しました。 >>> (または'2>&1') >>> >> 2>&1を採用しました。 > > > Rcmd.pmの162行目の > . $this->{cmd} . " 2>&1 " . $this->{log}); > リダイレクト(" > "、" >& "、" 2>&1 ")の > 挙動を > 以下のスクリプトで確認したところ、 > -------------------- > use Rcmd; > my $rcmd = new Rcmd; > my @result = $rcmd->exec("c(1:10)"); > print "print: @result \n"; > -------------------- > > " > "と" >& "では、以下の正しい出力が得られますが、 > -------------------- > print: 1 2 3 4 5 6 7 8 9 10 > -------------------- > > " 2>&1 "では、以下の出力が得られてしまいます。(@result > が空) > -------------------- > ARGUMENT '/tmp/6110325511.67064.log' __ignored__ > > [1] 1 2 3 4 5 6 7 8 9 10 > print: > -------------------- From gaou @ sfc.keio.ac.jp Thu Apr 29 14:14:52 2010 From: gaou @ sfc.keio.ac.jp (Kazuharu Arakawa) Date: Thu, 29 Apr 2010 14:14:52 +0900 Subject: [Glang-devel] =?iso-2022-jp?b?GyRCJWolQCUkJWwlLyVIGyhCJz4mJw==?= =?iso-2022-jp?b?GyRCJEclKCVpITwbKEI=?= In-Reply-To: <3C2A0F53-BFAF-4FC6-97D6-865DE82B04BD@cornell.edu> References: <3C2A0F53-BFAF-4FC6-97D6-865DE82B04BD@cornell.edu> Message-ID: g. 変更しました。 On 2010/04/29, at 10:49, Haruo Suzuki wrote: > > g-language-1.8.11/lib/Rcmd.pm > 157行目 > . $this->{cmd} . " >& " . $this->{log}); > を > . $this->{cmd} . " > " . $this->{log} . " 2>&1"); > に変更願います。 > >> explanations here: >> https://wiki.ubuntu.com/DashAsBinSh >> >> I think there is a bug somewhere in Rcmd.pm, which does not >> support POSIX Shell, like line 156: >> >> system("/usr/bin/env R " . $this->{save} . " --slave < " >> . $this->{cmd} . " >& " . $this->{log}); >> >> should be >> >> system("/usr/bin/env R " . $this->{save} . " --slave < " >> . $this->{cmd} . " > " . $this->{log} . " 2>&1"); >> >> There might be other places like that. > > >>>> ■'>&'でエラー >>>> Ubuntu LinuxサーバでRcmd.pmを使用したところ、 >>>> sh: Syntax error: Bad fd number >>>> というエラーが出力されたので、とりあえず >>>> Rcmd.pmの162行目 >>>> . $this->{cmd} . " >& " . $this->{log}); >>>> のリダイレクトを'>'に変更してエラーを回避しました。 >>>> (または'2>&1') >>>> >>> 2>&1を採用しました。 >> >> >> Rcmd.pmの162行目の >> . $this->{cmd} . " 2>&1 " . $this->{log}); >> リダイレクト(" > "、" >& "、" 2>&1 ")の >> 挙動を >> 以下のスクリプトで確認したところ、 >> -------------------- >> use Rcmd; >> my $rcmd = new Rcmd; >> my @result = $rcmd->exec("c(1:10)"); >> print "print: @result \n"; >> -------------------- >> >> " > "と" >& "では、以下の正しい出力が得られますが、 >> -------------------- >> print: 1 2 3 4 5 6 7 8 9 10 >> -------------------- >> >> " 2>&1 "では、以下の出力が得られてしまいます。(@result >> が空) >> -------------------- >> ARGUMENT '/tmp/6110325511.67064.log' __ignored__ >> >> [1] 1 2 3 4 5 6 7 8 9 10 >> print: >> -------------------- > > _______________________________________________ > Glang-devel mailing list > Glang-devel @ lists.sourceforge.jp > http://lists.sourceforge.jp/mailman/listinfo/glang-devel