> thishost = `hostname`

 Try with 

 thishost = `hostname`.chomp

Guy Decoux