Sponsored Content
Full Discussion: shell pattern matching
Top Forums Shell Programming and Scripting shell pattern matching Post 302236241 by indianjassi on Monday 15th of September 2008 05:47:37 AM
Old 09-15-2008
First tell us what you have tried.

So that we can suggest you improvement..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Pattern matching in a shell script?

I'm looking for a way to match a particular string in another string and if a match is found execute some command. I found the case statement can be used like this; case word in ) command ;; ] ... esac If my string to find is say "foo" in the string $mystring... (1 Reply)
Discussion started by: paulobrad
1 Replies

2. Shell Programming and Scripting

Pattern matching in shell scripting.

Hey Guys, I have a shell script that is very simple and does the following. #!/usr/bin/bash set -x echo -n "can you write device drivers?" read answer if then echo "wow, you must be very skilled" else echo "neither can i, i am just shell script" fi you see where the... (6 Replies)
Discussion started by: Irishboy24
6 Replies

3. Shell Programming and Scripting

shell script pattern matching

Hi, I need to create a shell script through which i need to populate email addresses in email columns of database table in mysql. Let say if email contains yahoo, hotmail, gtalk than email addresses need to move in their respective columns. # !/bin/sh yim="example@yahoo.com"... (3 Replies)
Discussion started by: mirfan
3 Replies

4. Shell Programming and Scripting

Pattern matching in shell script

Hi, I am using following command to extract string from a file. String will be after last / (slash). awk -F\ / '{print $NF}' $FILE but while appending the output in file in script, it dosent work. File created but of zero size... can anyone please help `awk -F\\\/ '{print $NF}' $FILE` >... (3 Replies)
Discussion started by: Deei
3 Replies

5. Shell Programming and Scripting

Korn Shell for pattern matching and extracting

Guys, i'm new to shell scripting. Here's what i need. I need a shell script which would read a file containing only 1 line which never changes. File containts - SQL_Mgd_Svc_ELONMCL54496 |EMEA\brookkev, EMEA\fieldgra, EMEA\tidmamar, EMEA\attfiste, EMEA\baldogar, EMEA\clarkia2, EMEA\conwasha,... (9 Replies)
Discussion started by: butterfly20
9 Replies

6. Shell Programming and Scripting

awk pattern matching and shell issue.

Please help me in this issue. I am unable to get the job,seems the awk not browsing the files. Please find my tries below. I have attached two files : 1.tobesearched.txt - a glimpse of a huge log file. 2.searchstring.txt - searching keys. these are the two scripts i tried writing: ... (7 Replies)
Discussion started by: deboprio
7 Replies

7. Shell Programming and Scripting

Help me to find files in a shell script with any matching pattern

Hi friends.. I have many dirs in my working directory. Every dir have thousands of files (.jsp, .java, .xml..., etc). So I am working with an script to find every file recursively within those directories and subdirectories ending with .jsp or .java which contains inside of it, the the pattern... (3 Replies)
Discussion started by: hnux
3 Replies

8. Shell Programming and Scripting

Pattern matching and replace in shell script

Hi I want to find a line in a file which contains a word and replace the patterns. Sample file content temp.xml ==================== <applications> <application> Name="FirstService" location="http://my.website.selected/myfirstService/V1.0/myfirst.war" ... (1 Reply)
Discussion started by: sakthi.99it
1 Replies

9. Shell Programming and Scripting

Non-greedy pattern matching in shell script

Hi all, Is Perl included by default in Ubuntu? I'm trying to write a program using as few languages as possible, and since I'm using a few Perl one-liners to do non-greedy matching, it's considered another language, and this is a bad thing. Basically, I'm using a Perl one-liner to grab XML... (3 Replies)
Discussion started by: Zel2008
3 Replies

10. Shell Programming and Scripting

Big pattern file matching within another pattern file in awk or shell

Hi I need to do a patten match between files . I am new to shell scripting and have come up with this so far. It take 50 seconds to process files of 2mb size . I need to tune this code as file size will be around 50mb and need to save time. Main issue is that I need to search the pattern from... (2 Replies)
Discussion started by: nitin_daharwal
2 Replies
hunspell(3)						     Library Functions Manual						       hunspell(3)

NAME
hunspell - spell checking, stemming, morphological generation and analysis SYNOPSIS
#include <hunspell/hunspell.hxx> /* or */ #include <hunspell/hunspell.h> Hunspell(const char *affpath, const char *dpath); Hunspell(const char *affpath, const char *dpath, const char * key); ~Hunspell(); int add_dic(const char *dpath); int add_dic(const char *dpath, const char *key); int spell(const char *word); int spell(const char *word, int *info, char **root); int suggest(char***slst, const char *word); int analyze(char***slst, const char *word); int stem(char***slst, const char *word); int stem(char***slst, char **morph, int n); int generate(char***slst, const char *word, const char *word2); int generate(char***slst, const char *word, char **desc, int n); void free_list(char ***slst, int n); int add(const char *word); int add_with_affix(const char *word, const char *example); int remove(const char *word); char * get_dic_encoding(); const char * get_wordchars(); unsigned short * get_wordchars_utf16(int *len); struct cs_info * get_csconv(); const char * get_version(); DESCRIPTION
The Hunspell library routines give the user word-level linguistic functions: spell checking and correction, stemming, morphological generation and analysis in item-and-arrangement style. The optional C header contains the C interface of the C++ library with Hunspell_create and Hunspell_destroy constructor and destructor, and an extra HunHandle parameter (the allocated object) in the wrapper functions (see in the C header file hunspell.h). The basic spelling functions, spell() and suggest() can be used for stemming, morphological generation and analysis by XML input texts (see XML API). Constructor and destructor Hunspell's constructor needs paths of the affix and dictionary files. See the hunspell(4) manual page for the dictionary format. Optional key parameter is for dictionaries encrypted by the hzip tool of the Hunspell distribution. Extra dictionaries The add_dic() function load an extra dictionary file. The extra dictionaries use the affix file of the allocated Hunspell object. Maximal number of the extra dictionaries is limited in the source code (20). Spelling and correction The spell() function returns non-zero, if the input word is recognised by the spell checker, and a zero value if not. Optional reference variables return a bit array (info) and the root word of the input word. Info bits checked with the SPELL_COMPOUND, SPELL_FORBIDDEN or SPELL_WARN macros sign compound words, explicit forbidden and probably bad words. From version 1.3, the non-zero return value is 2 for the dictionary words with the flag "WARN" (probably bad words). The suggest() function has two input parameters, a reference variable of the output suggestion list, and an input word. The function returns the number of the suggestions. The reference variable will contain the address of the newly allocated suggestion list or NULL, if the return value of suggest() is zero. Maximal number of the suggestions is limited in the source code. The spell() and suggest() can recognize XML input, see the XML API section. Morphological functions The plain stem() and analyze() functions are similar to the suggest(), but instead of suggestions, return stems and results of the morphological analysis. The plain generate() waits a second word, too. This extra word and its affixation will be the model of the morphological generation of the requested forms of the first word. The extended stem() and generate() use the results of a morphological analysis: char ** result, result2; int n1 = analyze(&result, "words"); int n2 = stem(&result2, result, n1); The morphological annotation of the Hunspell library has fixed (two letter and a colon) field identifiers, see the hunspell(4) manual page. char ** result; char * affix = "is:plural"; // description depends from dictionaries, too int n = generate(&result, "word", &affix, 1); for (int i = 0; i < n; i++) printf("%s0, result[i]); Memory deallocation The free_list() function frees the memory allocated by suggest(), analyze, generate and stem() functions. Other functions The add(), add_with_affix() and remove() are helper functions of a personal dictionary implementation to add and remove words from the base dictionary in run-time. The add_with_affix() uses a second word as a model of the enabled affixation of the new word. The get_dic_encoding() function returns "ISO8859-1" or the character encoding defined in the affix file with the "SET" keyword. The get_csconv() function returns the 8-bit character case table of the encoding of the dictionary. The get_wordchars() and get_wordchars_utf16() return the extra word characters definied in affix file for tokenization by the "WORDCHARS" keyword. The get_version() returns the version string of the library. XML API The spell() function returns non-zero for the "<?xml?>" input indicating the XML API support. The suggest() function stems, analyzes and generates the forms of the input word, if it was added by one of the following "SPELLML" syntaxes: <?xml?> <query type="analyze"> <word>dogs</word> </query> <?xml?> <query type="stem"> <word>dogs</word> </query> <?xml?> <query type="generate"> <word>dog</word> <word>cats</word> </query> <?xml?> <query type="generate"> <word>dog</word> <code><a>is:pl</a><a>is:poss</a></code> </query> The outputs of the type="stem" query and the stem() library function are the same. The output of the type="analyze" query is a string contained a <code><a>result1</a><a>result2</a>...</code> element. This element can be used in the second syntax of the type="generate" query. EXAMPLE
See analyze.cxx in the Hunspell distribution. AUTHORS
Hunspell based on Ispell's spell checking algorithms and OpenOffice.org's Myspell source code. Author of International Ispell is Geoff Kuenning. Author of MySpell is Kevin Hendricks. Author of Hunspell is Laszlo Nemeth. Author of the original C API is Caolan McNamara. Author of the Aspell table-driven phonetic transcription algorithm and code is Bjorn Jacke. See also THANKS and Changelog files of Hunspell distribution. 2011-02-01 hunspell(3)
All times are GMT -4. The time now is 09:10 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy