From: Park Heesob Date: 2002-09-05T00:04:37+09:00 Subject: Re: How to capture stderr while using backtick? Hi, "Shashank Date" wrote in message news:20020903214306.16461.qmail@web12306.mail.yahoo.com... > Ruby Gurus, > > I am using backticks in my ruby script to run DOS > commands, but cannot figure out how to separate the > stdin from stderr. > > Please see transcript below for what I am trying to > do: > > -------------- begin transcript ------------- > C:\>dir z > Volume in drive C is LOCAL > Volume Serial Number is AC53-D8CC > > Directory of C:\ > > File Not Found > > C:\>ruby -ve 'puts `dir z`' > ruby 1.7.2 (2002-06-03) [i386-mswin32] > File Not Found > Volume in drive C is LOCAL > Volume Serial Number is AC53-D8CC > > Directory of C:\ > ----------- end transcript ----------------- > > Notice how, when I use Ruby, the stderr message "File > Not Found" shows up first and then stdin msgs. > > How do I separate the two streams? > > TIA, > -- Shanko Refer to http://www.rubytalk.com/blade/44186 Park Heesob