``echo "abc"`` outputs "abc\n", try this instead

    echo -n abc | ruby -e "puts gets.chomp 'c'"

Roy

On Sat, Apr 16, 2011 at 11:08:10AM +0900, Steel Steel wrote:
> Using 1.9.1
> I noticed something with chomp
> 
> $ echo "abc" | ruby -e 'puts gets.chomp("c")'
> abc
> 
> $ irb
> irb(main):001:0> "abc".chomp("c")
> => "ab"
> 
> It doesn't work on the command line, or am i doing it wrong.?
> comments?
> 
> -- 
> Posted via http://www.ruby-forum.com/.
> 

-- 
 ___________________________________________________________________ 
/ She's the kind of girl who climbed the ladder of success wrong by \
| wrong.                                                            |
|                                                                   |
\ -- Mae West                                                       /
 ------------------------------------------------------------------- 
       \   ,__,
        \  (oo)____
           (__)    )\
              ||--|| *