I am trying to assign the output of hostname to a variable and use it in my script. While I was able to get the variable to another logic, when I try to print the variable it doesn't print the variable.Here is what I am looking to do:the hostname on the server returns xy29abcd01.I want to assign this to a variable and then use it to remove 3rd and 4th characters of the hostname and assign it to another variable.Here is what I have#!/bin/kshprint  Get queue manager nameSERVER=echo `hostname`print$SERVERexport QMGR=`$SERVER |cut -c1-2,5-10| tr [[:lower:]] [[:upper:]`print Queue manager name $QMGRAnd here is the output When I run this:Get queue manager name./test.sh[13]: printecho xy29abcd01: not found [No such file or directory]Queue manager name XYABCD01What am I doing wrong here to assigning the SERVER variable. Desired output itxy29abcd01Queue manager name XYABCD01
Assign hostname to a variable in ksh
ksh;variable;hostname