Sponsored Content
Top Forums Shell Programming and Scripting Help--Using wildcards in string comparison Post 302313787 by louciano on Wednesday 6th of May 2009 01:01:06 PM
Old 05-06-2009
Thanks for the post. Needed the info as well.Smilie
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

string comparison

The script will read a bunch of names, and test if it contains "John", but as below apparently ~ does not work, so what is the easiest way to perform string comparison in bash shell script? thanks ... elif then echo "get John" .... (2 Replies)
Discussion started by: fedora
2 Replies

2. Shell Programming and Scripting

string comparison

Hello experts, (tcsh shell) Quite new to shell scripting... I have got a file with a single word on each line. Want to be able to make a comparison such that i can read pairs of words that are ROT13 to each other. Also, i would like to print the pairs to another file. Any help... (5 Replies)
Discussion started by: Jatsui
5 Replies

3. Shell Programming and Scripting

Help with String Comparison

I'm running the following script to compare string values to a regexp: for entry in $(lpinfo -v | cut -c 1-); do if then echo "blah" continue fi done Whenever I run it, each token of lpinfo is being interpreted as a command and I get errors such as: ... (2 Replies)
Discussion started by: hypnotic_meat
2 Replies

4. Shell Programming and Scripting

String Comparison

Is there a way to compare the permission string of two files and output the string if they match? For ex: -rw-r--r-- 1 user newuser 0 2009-03-12 16:45 file2 -rw-r--r-- 1 user newuser 0 2009-03-12 16:46 fileone output: -rw-r--r-- If they don't match output will be just... (3 Replies)
Discussion started by: squardius
3 Replies

5. Shell Programming and Scripting

Find string in list with wildcards

I need to add code to a shell script to find out if a string matches any item in a list, where the list can contain a wildcard character. For example, if I have the following list: ok_versions="03-02-4, 04-01-*" Then I want to compare a particular string to see if it matches any item in... (11 Replies)
Discussion started by: Johan III
11 Replies

6. UNIX and Linux Applications

Need Help on String Comparison

Hi , My requirement is to read from a file into a variable. I need to check if the variable is equal to string "no rows selected". The sh script snippet is as follows: file=/data/lpgtwo/home/nikhilp/TriggerNames.txt echo $file var=`cat $file` echo $var if then echo "No... (3 Replies)
Discussion started by: MNG
3 Replies

7. Shell Programming and Scripting

to extract string from main string and string comparison

continuing from my previous post, whose link is given below as a reference https://www.unix.com/shell-programming-scripting/171076-shell-scripting.html#post302573569 consider there is create table commands in a file for eg: CREATE TABLE `Blahblahblah` ( `id` int(11) NOT NULL... (2 Replies)
Discussion started by: vivek d r
2 Replies

8. Homework & Coursework Questions

passing letters from an array into a string for string comparison

attempting the hangman program. This was an optional assignment from the professor. I have completed the logical coding, debugging now. ##I have an array $wordString that initializes to a string of dashes ##reflecting the number of letters in $theWord ##every time the user enters a (valid)... (5 Replies)
Discussion started by: lotsofideas
5 Replies

9. Shell Programming and Scripting

String comparison

hi team, i want to compare the below string from logs, but its is not working. if ]; then echo "restart some process" fi (4 Replies)
Discussion started by: mfaizan40
4 Replies

10. Shell Programming and Scripting

awk string comparison unterminated quoted string andrule of thumb

I have the logic below to look up for matches within the columns between the two files with awk. In the if statement is where the string comparison is attempted with == The issue seems to be with the operands, as 1. when " '${SECTOR}' " -- double quote followed by single quote -- awk matches... (1 Reply)
Discussion started by: deadyetagain
1 Replies
fstrcolli(3)						     Library Functions Manual						      fstrcolli(3)

NAME
fstrcolli - fuzzy comparison of two strings using the current locale SYNOPSIS
#include <fstrcmp.h> #define FSTRCMP_IDENTICAL #define FSTRCMP_THRESHOLD #define FSTRCMP_ERROR int fstrcolli(const char *string1, const char *string2); DESCRIPTION
The strcolli() function compares the two strings sting1 and string2. The comparison is based on strings interpreted as appropriate for the program's current locale for category LC_CTYPE. RETURN VALUE
The fstrcolli function returns an int value between 0 and FSTRCMPI_IDENTICAL. A value of 0 means the strings are utterly un-alike. A value of FSTRCMPI_IDENTICAL means the strings are identical. A value of more than FSTRCMPI_THRESHOLD (it lies between 0 and FSTRCMPI_IDEN- TICAL) would be considered "similar" by most people. A value of FSTRCMPI_ERROR (always negative) indicates a malloc(3) or mbstowcs(3) failure. SEE ALSO
fstrcmpi(3) fuzzy comparison of two strings fstrcoll(3) fuzzy comparison of two strings using the current locale strcoll(3) compare two strings using the current locale mbstowcs(3) convert a multibyte string to a wide-character string COPYRIGHT
fstrcmp version 0.4 Copyright (C) 2009 Peter Miller Peter Miller <pmiller@opensource.org.au> The comparison code is derived from the fuzzy comparison functions in GNU Gettext 0.17. The GNU Gettext comparison functions were, in turn, derived from GNU Diff 2.7. Copyright (C) 1988-2009 Free Software Foundation fstrcolli(3)
All times are GMT -4. The time now is 06:57 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy