From: Jim Freeze Date: 2003-08-26T02:46:20+09:00 Subject: Re: Ruby launching system apps? On Tuesday, 26 August 2003 at 2:25:04 +0900, Dan wrote: > I have a UNIX machine and I want a ruby app that can launch UNIX commands > like awk or sed...how would I implement this? > > use Shell.new? Either `sys cmd here` or system("sys cmd here") The backticks `` capture the output return it as a string. The system command returns sucess or failure. ri system This is a test 'ri'. Please report errors and omissions on http://www.rubygarden.org/ruby?RIOnePointEight --------------------------------------------------------- Kernel::system system( aCmd [, args]* ) -> true or false ------------------------------------------------------------------------ Executes aCmd in a subshell, returning true if the command was found and ran successfully, false otherwise. An error status is available in $?. The arguments are processed in the same way as for Kernel::exec on page 419. system("echo *") system("echo", "*") produces: config.h main.rb * -- Jim Freeze ---------- "I used to think that the brain was the most wonderful organ in my body. Then I realized who was telling me this." -- Emo Phillips