I am trying to run simple shell commands in my script, but I can not 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`.chop() h=`echo '#{l}' | cut -d: -f1`.chop()
Any suggestions?
According to some suggestions, changed my code to:
h, p1, p2, u = l.split /:/ u.strip u.chomp puts u.inspect
Output: "string\n"
I basically tried to use chomp before and ran into the same problem. Do I need to call chomp differently or add some kind of stone?
source share