I want to extract the host name of a machine and omit whatever exists after
.. For example, the command
compute-0-0.local. So, I used `cut command like this
# hostname | cut -f 1 -d "." compute-0-0
Now, I want to put that output in a variable. The following command doesn't work.
# HT=`hostname` | cut -f 1 -d "." # echo $HT compute-0-0.local
Any way to fix that?