You can use sed as follows
Code:
echo "narendra.eukhost.com" | cut -d'.' -f1
You can store all subdomains in a file or variable and run for loop:
Code:
#!/bin/sh
DOMAINS="narendra.eukhost.com txt.xyz.com abc.yyyy.co.in"
for d in $DOMAINS
do
echo $d | cut -d'.' -f1
done
__________________
Rocky Jr.
You may have my body & soul, but you will never touch my pride!
If you have knowledge, let others light their candles at it.
Certified to work on
HP-UX /
Sun Solaris /
RedHat