Sponsored Content
Full Discussion: Parse string
Top Forums Shell Programming and Scripting Parse string Post 302350961 by ktm on Sunday 6th of September 2009 03:25:04 PM
Old 09-06-2009
Unfortunately it doesn't work because I don't know if will be a domain or a subdomain. If the output is:
mydomain.com
dev.mydomain.com

I need to parse each string and strip the domain and periods.It works with tr but the problem is how do i check if it's a subdomain.For the two strings above it should result:

mydomain
devmydomain
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

parse a string variable

Hello all, need a little help. I have an input variable such as ARGV which equals something like /use/home/name/script/test.dat I need to be able to get just the "test.dat" (i.e. the file name) at the end of the directory and the directory can be anything and any length. To put it another... (3 Replies)
Discussion started by: methos
3 Replies

2. Shell Programming and Scripting

String parse question

I have a string of data that looks like this: private.enterprises.954.1.1.1.1.1.2618 \(OctetString\): U private.enterprises.954.1.1.1.1.2.2618 \(OctetString\): 2618 I am trying to parse the string to only return the values after the ":". Ex from above "U" and "2618". Any suggestions? (5 Replies)
Discussion started by: mnreferee
5 Replies

3. Shell Programming and Scripting

how to parse this string

I want to get filenames from the following input. How can I parse this in bash. input data ------------------------------------------------------------------- path=/aaa/bbb/filename1;/aaa/filename2;/aaa/bbb/ccc/ddd/filename3 -------------------------------------------------------------------... (13 Replies)
Discussion started by: hcliff
13 Replies

4. Shell Programming and Scripting

Parse String Using Sed

Hi, I am wondering if there's a simpler way to extract the second occurrence of a word enclosed in that matches my search criteria. Sample Input is as follows: Error installing feature - com.er.nms.cif.ist.NoMatchingUpgra Error installing feature -... (4 Replies)
Discussion started by: racbern
4 Replies

5. UNIX for Dummies Questions & Answers

parse string with awk

Hi Guys, I spend half a day getting this to work with no luck, perhaps you guys can help.. I have a string from a file looking like this: module::name=test::type=generic_data::exec=snmpget.......::desc=A Little Test::interval=300 what I would like to split it, so I get a value for each... (3 Replies)
Discussion started by: hyber
3 Replies

6. Shell Programming and Scripting

How to parse a string into variables

I'm working in korn shell and have a variable which contains a string like: aa_yyyymmdd_bbb_ccc_ddd.abc. I want to treat the _ and . as delimiters and parse the string so I end up with 6 values in variables that I can manipulate. My original plan was to use var1=`echo $sting1 | cut -c1-c2` but... (9 Replies)
Discussion started by: aquimby
9 Replies

7. Shell Programming and Scripting

Search string and parse

Input file 0792 to 2450 iadmssql7: Copy: CNJ R1: Replication volumes: Replication set: RSet 1 Replication size: 200.00GB SAN Info: 200.00GB DGC VRAID CX4-960 LUN 17 (17) RPA Port WWN Ctrl ... (0 Replies)
Discussion started by: greycells
0 Replies

8. Shell Programming and Scripting

Parse a string as a command

I've a problem parsing a string as a command: Consider script stefano.sh as following: #!/usr/bin/sh txtshell="./parser.sh /ews/MyEventHandler/data/handler/StopAndMail.php eventid=StopAndMail.MVIN.6300 lot_number=1122FXB facility=EWSF3 'mailto=prova.prova@nohost.com, prova.test@nohost.com'... (2 Replies)
Discussion started by: buonstefano
2 Replies

9. Shell Programming and Scripting

parse a mixed alphanumeric string from within a string

Hi, I would like to be able to parse out a substring matching a basic pattern, which is a character followed by 3 or 4 digits (for example S1234 out of a larger string). The main string would just be a filename, like Thisis__the FileName_S1234_ToParse.txt. The filename isn't fixed, but the... (2 Replies)
Discussion started by: keaneMB
2 Replies

10. Programming

Perl parse string

Hi Perl Guys I have another perl question I have the following code that i have written Getopt::Long::config(qw( permute bundling )); my $OPT = {}; GetOptions($OPT, qw( ver=s help|h )) or die "options parsing failed"; This will allow the user to do something like... (4 Replies)
Discussion started by: ab52
4 Replies
CREATE 
DOMAIN(7) SQL Commands CREATE DOMAIN(7) NAME
CREATE DOMAIN - define a new domain SYNOPSIS
CREATE DOMAIN domainname [AS] data_type [ DEFAULT default_expr ] [ constraint [, ... ] ] where constraint is: [ CONSTRAINT constraint_name ] { NOT NULL | NULL } PARAMETERS domainname The name (optionally schema-qualified) of a domain to be created. data_type The underlying data type of the domain. This may include array specifiers. Refer to the User's Guide for further information about data types and arrays. DEFAULT The DEFAULT clause specifies a default value for columns of the domain data type. The value is any variable-free expression (but subselects are not allowed). The data type of the default expression must match the data type of the domain. The default expression will be used in any insert operation that does not specify a value for the column. If there is no default for a domain, then the default is NULL. Note: If a default value is specified for a particular column, it overrides any default associated with the domain. In turn, the domain default overrides any default value associated with the underlying data type. CONSTRAINT constraint_name An optional name for a constraint. If not specified, the system generates a name. NOT NULL Values of this domain are not allowed to be NULL. NULL Values of this domain are allowed to be NULL. This is the default. This clause is only available for compatibility with non-standard SQL databases. Its use is discouraged in new applications. OUTPUTS CREATE DOMAIN Message returned if the domain is successfully created. DESCRIPTION
CREATE DOMAIN allows the user to register a new data domain with PostgreSQL for use in the current data base. The user who defines a domain becomes its owner. If a schema name is given (for example, CREATE DOMAIN myschema.mydomain ...) then the domain is created in the specified schema. Otherwise it is created in the current schema (the one at the front of the search path; see CURRENT_SCHEMA()). The domain name must be unique among the types and domains existing in its schema. Domains are useful for abstracting common fields between tables into a single location for maintenance. An email address column may be used in several tables, all with the same properties. Define a domain and use that rather than setting up each table's constraints individually. EXAMPLES
This example creates the country_code data type and then uses the type in a table definition: CREATE DOMAIN country_code char(2) NOT NULL; CREATE TABLE countrylist (id INT4, country country_code); COMPATIBILITY
SQL99 defines CREATE DOMAIN, but says that the only allowed constraint type is CHECK constraints. CHECK constraints for domains are not yet supported by PostgreSQL. SEE ALSO
DROP DOMAIN [drop_domain(7)], PostgreSQL Programmer's Guide SQL - Language Statements 2002-11-22 CREATE DOMAIN(7)
All times are GMT -4. The time now is 11:40 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy