From: James Edward Gray II Date: 2007-04-11T21:33:12+09:00 Subject: Re: escapeshellcmd() for Ruby On Apr 11, 2007, at 7:20 AM, hawe wrote: > Is there something like PHP's escapeshellcmd() function which removes > special signs for system calls? Or do I have to do it myself and > escape > |;>"? What else? I'm not aware of anything, but TextMate uses to following code for shell escaping: # escape text to make it useable in a shell script as one �word� (string) def e_sh(str) str.to_s.gsub(/(?=[^a-zA-Z0-9_.\/\-\x7F-\xFF\n])/, '\\').gsub(/\n/, "'\n'").sub(/^$/, "''") end Not sure how portable that is, but hopefully it will get you started. James Edward Gray II