![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| My Deleted SubDomain is mirroring main site | upirate | UNIX for Dummies Questions & Answers | 2 | 03-23-2007 09:01 AM |
| how to know if a directory is normal one or subdomain? | hello20009876 | High Level Programming | 1 | 12-08-2005 01:11 PM |
| domain pointer for the subdomain | naik_mit | Linux | 0 | 06-22-2005 01:34 AM |
| email account for subdomain (HOW-TO) | collins | UNIX for Dummies Questions & Answers | 1 | 08-21-2004 01:39 PM |
| command find returned bash: /usr/bin/find: Argument list too long | yacsil | Shell Programming and Scripting | 1 | 12-15-2003 03:38 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
find subdomain in url
I want to find out subdomains in the url using shell script.
e.g narendra.eukhost.com abc.domainname.co.uk I want to extract narendra & abc from the above urls. Please any one can suggest idea or script ? |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
Code:
# echo $s
narendra.eukhost.com
# echo ${s%%.*}
narendra
# echo $s | awk -F"." '{print $1}'
narendra
# echo $s | python -c "print raw_input().split('.')[0]"
narendra
|
|
#3
|
|||
|
|||
|
Thanks ghostdog74 for the solution.
|
|||
| Google The UNIX and Linux Forums |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|