I have a wired problem. I tried to concatenate two strings. If I do this with @Client.ip I get a string with a new line. @Client.ip is a string.
I used this:
order= "net rpc shutdown #{ip} --user=administrator%***! --timeout=100 --force -C 'bla'"
or this
order= "net rpc shutdown "+ @client.ip + " --user=administrator%*** --timeout=100 --force -C 'bla'"
The result is this:
net rpc shutdown 178.213.111.69
--user=administrator%*** --timeout=100 --force -C 'bla'
If I write the ip manually and concatenate it then, it works fine and everything is in one line …. Why is that happening? Has someone an idea? 🙂 I need this string in one line to use the system(-) command.
It sounds like
@client.iphas a newline at the end of it. Try striping it outString#rstripwill remove any whitespace at the end of the string.