From: Dan Nachbar Date: 2011-09-24T04:03:59+09:00 Subject: Re: Get rid of newline from shell commands in Ruby On Sep 23, 2011, at 2:36 PM, Pavan .. wrote: > I am trying to run simple shell commands in my script, but am unable to > get rid of new lines even using chomp or chop. > > Is there something I am missing ? > > u=`echo '#{l}' | cut -d: -f4`.chop() > p2=`echo '#{l}' | cut -d: -f3`.chop() > p1=`echo '#{l}' | cut -d: -f2`.chomp() > h=`echo '#{l}' | cut -d: -f1`.chop() > > > # **Cant get newlines to go !! ??** > path="#{p1}/#{@CODELINEFILTER}#{p2}" > puts path > > Any suggestions ? > You might try using echo -n and sidestep the problem completely. Dan Nachbar