From: Shashank Date Date: 2003-07-12T22:01:59+09:00 Subject: Re: Getting my IP address "daz" wrote in message > C:\WINDOWS>ruby -rsocket -e'puts IPSocket.getaddress(Socket.gethostname)' > > ... gives nothing / no error msg. > > C:\WINDOWS>ruby -rsocket -e 'puts IPSocket.getaddress(Socket.gethostname)' > 213.249.173.103 > > Difference: a space after -e Yes, I stumbled on it too. One more thing one should be aware of: the single quote around the ruby script does not always work. In that case use double quote. Like: C:\>ruby -ve '1.times{|i| puts i}' ruby 1.8.0 (2003-06-23) [i386-mswin32] -e:1: unterminated string meets end of file 'i' is not recognized as an internal or external command, operable program or batch file. C:\>ruby -e "1.times{|i| puts i}" 0 Apparently if single quotes are used, DOS does not escape the special characters in this case the pipe '|' symbol before 'i'. But everything is fine within the double quotes. This is on WIN XP Pro. > Space after -r is optional, apparently. Yes. > I'll go and produce my "language stress graph" for this week ;) I bet there are only three points of stress ;) (read the section "Dangerous Ruby" Pages [25,26] of Ruby Developer's Guide for more details). > daz -- shanko > ruby -rwavy -e 'puts Wavy.line(rand(80), rand(6), ".")' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ What ?