Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

strncasecmp(9f) [sunos man page]

strcmp(9F)						   Kernel Functions for Drivers 						strcmp(9F)

NAME
strcmp, strcasecmp, strncasecmp, strncmp - compare two null-terminated strings. SYNOPSIS
#include <sys/ddi.h> int strcmp(const char *s1, const char *s2); int strcasecmp(const char *s1, const char *s2); int strncasecmp(const char *s1, const char *s2, size_t n); int strncmp(const char *s1, const char *s2, size_t n); INTERFACE LEVEL
Solaris DDI specific (Solaris DDI). PARAMETERS
s1, s2 Pointers to character strings. n Count of characters to be compared. DESCRIPTION
strcmp() strcmp() returns 0 if the strings are the same, or the integer value of the expression (*s1 - *s2) for the last characters compared if they differ. strcasecmp(), strncasecmp() The strcasecmp() and strncasecmp() functions are case-insensitive versions of strcmp() and strncmp(), respectively, described in this sec- tion. They assume the ASCII character set and ignore differences in case when comparing lowercase and uppercase characters. strncmp() strncmp() returns 0 if the first n characters of s1 and s2 are the same, or (*s1 - *s2) for the last characters compared if they dif- fer. RETURN VALUES
strcmp() returns 0 if the strings are the same, or (*s1 - *s2) for the last characters compared if they differ. strcasecmp() and strncasecmp() return values in the same fashion as strcmp() and strncmp(), respectively. strncmp() returns 0 if the first n characters of strings are the same, or (*s1 - *s2) for the last characters compared if they differ. CONTEXT
These functions can be called from user or interrupt context. SEE ALSO
Writing Device Drivers SunOS 5.10 1 Apr 1994 strcmp(9F)

Check Out this Related Man Page

strcmp(9F)						   Kernel Functions for Drivers 						strcmp(9F)

NAME
strcmp, strcasecmp, strncasecmp, strncmp - compare two null-terminated strings. SYNOPSIS
#include <sys/ddi.h> int strcmp(const char *s1, const char *s2); int strcasecmp(const char *s1, const char *s2); int strncasecmp(const char *s1, const char *s2, size_t n); int strncmp(const char *s1, const char *s2, size_t n); INTERFACE LEVEL
Solaris DDI specific (Solaris DDI). PARAMETERS
s1, s2 Pointers to character strings. n Count of characters to be compared. DESCRIPTION
strcmp() strcmp() returns 0 if the strings are the same, or the integer value of the expression (*s1 - *s2) for the last characters compared if they differ. strcasecmp(), strncasecmp() The strcasecmp() and strncasecmp() functions are case-insensitive versions of strcmp() and strncmp(), respectively, described in this sec- tion. They assume the ASCII character set and ignore differences in case when comparing lowercase and uppercase characters. strncmp() strncmp() returns 0 if the first n characters of s1 and s2 are the same, or (*s1 - *s2) for the last characters compared if they dif- fer. RETURN VALUES
strcmp() returns 0 if the strings are the same, or (*s1 - *s2) for the last characters compared if they differ. strcasecmp() and strncasecmp() return values in the same fashion as strcmp() and strncmp(), respectively. strncmp() returns 0 if the first n characters of strings are the same, or (*s1 - *s2) for the last characters compared if they differ. CONTEXT
These functions can be called from user or interrupt context. SEE ALSO
Writing Device Drivers SunOS 5.10 1 Apr 1994 strcmp(9F)
Man Page

8 More Discussions You Might Find Interesting

1. Programming

C snipet on char Pointers

I have small Dout. please respond. char *p; p=" I am a Very good boy"; Is this valid or not? If not valid why is it so? It is not giving any compilation error. Thanks Vinod (3 Replies)
Discussion started by: gandhevinod
3 Replies

2. Programming

strcmp core dumps

hi everyone, Right now when I do: strcmp(s1, s2); i get a core dump because at times s1 or s2 can be nothing so that makes strcmp() core dump. What is the solution, if at times I expect one of them (or both) to be NULL? I want to be able to compare that s1 is NULL and s2 is "blah" or... (6 Replies)
Discussion started by: annie
6 Replies

3. Shell Programming and Scripting

comparing 2 strings

hi i have 2 strings. i want to compare the strings. please help (2 Replies)
Discussion started by: satish@123
2 Replies

4. Shell Programming and Scripting

comparing two strings

hi All i am facing prob in comparing two strings that have two word. below is the code snippet. checkValidates="file validates" file3_name="file" if then echo "file" $file3_name "is validated successfully" fi when i run this i get the error as -bash: [: too many arguments ... (1 Reply)
Discussion started by: infyanurag
1 Replies

5. Shell Programming and Scripting

remove strings of lowercase characters (with minimum length requirement)

Hi all, I want to delete all lowercase characters from my file, but only strings of length 7 and more. For example, how can I go from: JHGEFigeIGDUIirfyfiyhgfoiyfKJHGuioyrDHG To: JHGEFigeIGDUIKJHGuioyrDHG There should be a trick to add to sed 's///g', but I can't figure it out.... (2 Replies)
Discussion started by: elbuzzo
2 Replies

6. UNIX for Dummies Questions & Answers

tr command

Hi all, man tr says tr ... SET1 SETs are specified as strings of characters I did not understand the terms " strings of characters" when I surfed the net I got some examples like tr -d '\015' file1 Does \015 is string of characters or '\015' is string of characters. Basically I... (4 Replies)
Discussion started by: pushparaj_bits
4 Replies

7. UNIX for Dummies Questions & Answers

Finding specific series of strings or characters

After spending sometime playing around with my script I just cannot get it to do what I want. So I decided to ask. My file looks something like this: I am using the following code to extract sequences that contain dashes awk '/^>/{id=$0;next}{if (match($1,"-")) print id "\n" $0}' infile ... (17 Replies)
Discussion started by: Xterra
17 Replies

8. Programming

Hidden strcmp in glibc

In glibc in file strcmp I see a definition of strcmp function and below it there is a macro "libc_hidden_builtin_def (strcmp)". This macro "libc_hidden_builtin_def (strcmp)" looks to be defining some platform(x32-64, i386) specific implementation of strcmp. Question is when is this... (7 Replies)
Discussion started by: rupeshkp728
7 Replies