Quote:
Originally Posted by schneidz
Code:
hostname | cut -b -3
|
Thanks Schneidz for a prompt response
So hostname | cut -b -3 gets me the string for env variable (dev,tes & pro)
once after cutting the hostname how do I need to assign the output to Env variable
Can I use the below option
#!/bin/sh
#set -x
HOSTNAME=$(hostname | cut -b -3)
env=$HOSTNAME
echo $env