This is a discussion on find subdomains in url within the Shell scripting forums, part of the Development/Scripting category; I want to find out subdomains in the url usinf shell script. e.g narendra.eukhost.com abc.domainname.co.uk I want to find extract ...
|
|||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
|
|||
|
I want to find out subdomains in the url usinf shell script.
e.g narendra.eukhost.com abc.domainname.co.uk I want to find extract narendra & abc from the above urls. Please any one can suggest idea or script ? |
| Sponsored Links | ||
|
|
|
||||
|
You can use sed as follows
Code:
echo "narendra.eukhost.com" | cut -d'.' -f1 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 |
![]() |
| Bookmarks |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) |
|
| Thread Tools | |
| Display Modes | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Lighttpd socket with multiple subdomains or single IP | muks | Web servers | 2 | 03-17-2007 04:48 AM |
| find out what chip nic | Linux software | 1 | 01-30-2006 04:06 PM | |