Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

tcl_stringcasematch(3tcl) [debian man page]

Tcl_StringMatch(3tcl)					      Tcl Library Procedures					     Tcl_StringMatch(3tcl)

__________________________________________________________________________________________________________________________________________________

NAME
Tcl_StringMatch, Tcl_StringCaseMatch - test whether a string matches a pattern SYNOPSIS
#include <tcl.h> int Tcl_StringMatch(str, pattern) int Tcl_StringCaseMatch(str, pattern, flags) ARGUMENTS
const char *str (in) String to test. const char *pattern (in) Pattern to match against string. May contain special characters from the set *?[]. int flags (in) OR-ed combination of match flags, currently only TCL_MATCH_NOCASE. 0 specifies a case-sensitive search. _________________________________________________________________ DESCRIPTION
This utility procedure determines whether a string matches a given pattern. If it does, then Tcl_StringMatch returns 1. Otherwise Tcl_StringMatch returns 0. The algorithm used for matching is the same algorithm used in the string match Tcl command and is similar to the algorithm used by the C-shell for file name matching; see the Tcl manual entry for details. In Tcl_StringCaseMatch, the algorithm is the same, but you have the option to make the matching case-insensitive. If you choose this (by passing TCL_MATCH_NOCASE), then the string and pattern are essentially matched in the lower case. KEYWORDS
match, pattern, string Tcl 8.5 Tcl_StringMatch(3tcl)

Check Out this Related Man Page

Tcl_StringMatch(3)					      Tcl Library Procedures						Tcl_StringMatch(3)

__________________________________________________________________________________________________________________________________________________

NAME
Tcl_StringMatch, Tcl_StringCaseMatch - test whether a string matches a pattern SYNOPSIS
#include <tcl.h> int Tcl_StringMatch(str, pattern) int Tcl_StringCaseMatch(str, pattern, flags) ARGUMENTS
const char *str (in) String to test. const char *pattern (in) Pattern to match against string. May contain special characters from the set *?[]. int flags (in) OR-ed combination of match flags, currently only TCL_MATCH_NOCASE. 0 specifies a case-sensitive search. _________________________________________________________________ DESCRIPTION
This utility procedure determines whether a string matches a given pattern. If it does, then Tcl_StringMatch returns 1. Otherwise Tcl_StringMatch returns 0. The algorithm used for matching is the same algorithm used in the string match Tcl command and is similar to the algorithm used by the C-shell for file name matching; see the Tcl manual entry for details. In Tcl_StringCaseMatch, the algorithm is the same, but you have the option to make the matching case-insensitive. If you choose this (by passing TCL_MATCH_NOCASE), then the string and pattern are essentially matched in the lower case. KEYWORDS
match, pattern, string Tcl 8.5 Tcl_StringMatch(3)
Man Page

15 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

how to search for a str and replace it..

in my file, i like to search for a string and if there is a match then i want to replace it with someother string(like in windows wordpad). i only know how to search for a pattern.... but i dont know how to replace it.. and 1). i think it is there in unix grep or some other commends... if... (6 Replies)
Discussion started by: sekar sundaram
6 Replies

2. Shell Programming and Scripting

Search for a Pattern and Replace

Hello All, Can you help me with this , I need to search a pattern replace it with the new pattern in all the files in a directory. what would be the easiest way to do that? Thanks in advance. :) Sam, (6 Replies)
Discussion started by: sbasetty
6 Replies

3. Shell Programming and Scripting

pattern matching

hi , i am trying to search for a pattern in the file and then replace the pattern. please guide me Thanks, Mahi (7 Replies)
Discussion started by: adityamahi
7 Replies

4. Shell Programming and Scripting

SED: delete matching row and 4 next rows?

Hi, Tried to look for solution, and found something similar but could not adapt the solution for my needs.. I'm trying to match a pattern (in this case "ProcessType")in a logfile, then delete that line and the 4 following lines. The logfile looks as follows: ProcessType: PROCESS_A... (5 Replies)
Discussion started by: Juha
5 Replies

5. Shell Programming and Scripting

Sed - Pattern Searching

Hi, Please take a look at the below eg. I would like to search for abc() pattern first and then search for (xyz) in the next line. If I can find the pattern, then I should delete the 3 lines. I can only find the pattern and delete but I am unable to find two patterns and delete. Any... (8 Replies)
Discussion started by: sreedevi
8 Replies

6. Shell Programming and Scripting

Find and Replace pattern in lowercase

I have an xml file. I need to convert a particular pattern to lower case and add 1 to it. For example my sample values in file are: ergeAAwrgersc_DWSTAGE_AC_DBO_TBL_GROUPZONES_INITIAL.badAAergerg sc_DWSTAGE_AC_DBO_TBL_SECTIONDEPENDENCY_INITIAL.badeAAwrgewrg... (6 Replies)
Discussion started by: alfredo123
6 Replies

7. 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

8. Shell Programming and Scripting

Creating number by pattern matching

I have a certain mnemonic string from which I want to calculate a number The pattern follows three letters s, v and d. If a letter is by its own, the number assigned to the letter is assumed to be one. Else it takes the value preceeding it. I then need to add the numbers together. Example ... (5 Replies)
Discussion started by: kristinu
5 Replies

9. Shell Programming and Scripting

Awk to match a pattern and perform a search after the first pattern

Hello Guyz I have been following this forum for a while and the solutions provided are super useful. I currently have a scenario where i need to search for a pattern and start searching by keeping the first pattern as a baseline ABC DEF LMN EFG HIJ LMN OPQ In the above text i need to... (8 Replies)
Discussion started by: RickCharles
8 Replies

10. Shell Programming and Scripting

Pattern Match Script

Hi, I have a requirement in which I have to search the File name for pattern and if the pattern matches then I will have generate a value. Example: If $File_name='*NF' Then "NBC" Else $File_Name='SC*' Then "CBS" Else "FB" fi What is the best way to do this? I want to pass the... (6 Replies)
Discussion started by: btt3165
6 Replies

11. Shell Programming and Scripting

Match pattern and get lines numbers in a vector

Hi everyone, I am new to shell scripting, and would appreciate your help on following problem. I need to search a file for a pattern, then get the number of each line that matches the given pattern. Then I need to search those specific line numbers from the first file in a second file and... (6 Replies)
Discussion started by: dimcick
6 Replies

12. Shell Programming and Scripting

Script to Serach pattern and give number of occurrences

Hi, I want a script which search for a pattern "good" in a huge file and provide me number of occurences of such pattern in a file. lets say i have a file test.txt contents as below good is good but good is sometime bad and sometime good you are very good and good is always good ... (7 Replies)
Discussion started by: sv0081493
7 Replies

13. Shell Programming and Scripting

Searching for pattern in variable using case statements

i would like to search a variable for a pattern, without having make any calls to external tools. i have a code like this: COUNTPRO2="gine is very bad vine is pretty good" case "${COUNTPRO2}" in *vine*) factor=${COUNTPRO2} echo $factor ;; esac If the variable contains... (7 Replies)
Discussion started by: SkySmart
7 Replies

14. Shell Programming and Scripting

Shell script to search all files for every string in another file

Hello All I have a pattern.txt file in source directory ((/project/source/) in linux server and data looks like: 123abc17 234cdf19 235ifg20 I have multiple log files in log directory (/project/log/) in linux server and data for one log file looks like: <?xml version="1.0" processid... (11 Replies)
Discussion started by: pred55
11 Replies

15. Shell Programming and Scripting

Pattern search

Hi, Am trying to print all sequence that matches this pattern CGTTGggtTTCATT and their positions in my file but "ggt" can be any nucleotide. The sequence in big letters must match. I used awk 'BEGIN{match("CGTTGGGTTTCATT",/(GGT)+/);print RSTART,RLENGTH}' my_file > output but didnt get... (5 Replies)
Discussion started by: Ibk
5 Replies