Sponsored Content
Full Discussion: Short code driving me nuts.
Top Forums Shell Programming and Scripting Short code driving me nuts. Post 302285656 by avronius on Monday 9th of February 2009 12:28:40 PM
Old 02-09-2009
The string comparison would be for the y/n - not the mathematics
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

unix driving me crazy

:( :confused: what is performed by the following unix command: grep -v Jane project1.txt and grep ' 5\..' janet.txt (1 Reply)
Discussion started by: Tendernisin
1 Replies

2. UNIX for Dummies Questions & Answers

Dumb question but its driving me nuts

I use a tcsh and I need to monitor a file that its constantly updating. In the past I remember using less -(an option) fileName. This option told less to keep listening to this file and output the any changes. What is this option??? I think I read the man page for less like 5 times and I... (3 Replies)
Discussion started by: jepombar
3 Replies

3. Shell Programming and Scripting

Pleas help..this is driving me crazy

Hi, I've created a script in csh that takes a file and checks it for mispelled words. Im almost done but I need to do two more things but I need help. First, when displaying an incorrect word to the user, I need to show the line of the input file that contains the word. Second,if the user... (0 Replies)
Discussion started by: hckygoli31
0 Replies

4. Shell Programming and Scripting

Escape Characters are driving me crazy!

Hi everyone, Is there anywhere I can find a complete table of all characters that must be escaped by the various UNIX shells and scripting languages? It seems every command/shell/scripting language has different rules about what characters must be escaped. I do a lot of searching and... (3 Replies)
Discussion started by: troym72
3 Replies

5. UNIX for Dummies Questions & Answers

Variable with @ sign is driving me crazy

Ok so I am working on a command that is going to do a Dig @ a certain IP address which is enclosed in a variable. Now I thought I had this figure out because it works. The problem is that it does not ALWAYS work. the variable is IP=192.168.1.1 the commands I have tried are dig... (2 Replies)
Discussion started by: MrEddy
2 Replies

6. UNIX for Dummies Questions & Answers

Abnormal producer consumer problem driving me nuts

normally, i hate asking someone to do my homework for me but am getting desperate right now. i have a project about consumer producer problem. the deadline is tonight at 23:55. but i havent gotten it working yet. i just COULDNT get it to work right yet. the problem is as follows: the C - program... (0 Replies)
Discussion started by: alexantosh
0 Replies

7. Homework & Coursework Questions

Abnormal producer consumer problem driving me nuts

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: normally, i hate asking someone to do my homework for me but am getting desperate right now. i have a project... (1 Reply)
Discussion started by: alexantosh
1 Replies

8. Hardware

Name These Little Nuts for my Server Cabinet?

I bought a server cabinet recently and the person who sold it to me included some strange nuts. Can anyone tell me what they are called? I need to buy more. Below is the image of them. Thank you! http://s23.postimg.org/50fx2ge6j/image.jpg http://s23.postimg.org/o498isr0r/image.jpg ... (1 Reply)
Discussion started by: danijeljames
1 Replies

9. Shell Programming and Scripting

This is driving me nuts error on line 17

There is an error in this script on line 17 bee at it for 12 hour trying to find the problem, just lost. please help a newbie. line 17: #!/bin/sh 2 ## Name of the program is test_script_b.sh 3 4 ##request information from the user 5 echo enter 3 numbers 6 read a b c 7 8... (4 Replies)
Discussion started by: osdustin
4 Replies
u8_strcmp(3C)						   Standard C Library Functions 					     u8_strcmp(3C)

NAME
u8_strcmp - UTF-8 string comparison function SYNOPSIS
#include <sys/u8_textprep.h> int u8_strcmp(const char *s1, const char *s2, size_t n, int flag, size_t version, int *errnum); PARAMETERS
s1, s2 Pointers to null-terminated UTF-8 strings n The maximum number of bytes to be compared. If 0, the comparison is performed until either or both of the strings are exam- ined to the string terminating null byte. flag The possible comparison options constructed by a bit-wise-inclusive-OR of the following values: U8_STRCMP_CS Perform case-sensitive string comparison. This is the default. U8_STRCMP_CI_UPPER Perform case-insensitive string comparison based on Unicode upper case converted results of s1 and s2. U8_STRCMP_CI_LOWER Perform case-insensitive string comparison based on Unicode lower case converted results of s1 and s2. U8_STRCMP_NFD Perform string comparison after s1 and s2 have been normalized by using Unicode Normalization Form D. U8_STRCMP_NFC Perform string comparison after s1 and s2 have been normalized by using Unicode Normalization Form C. U8_STRCMP_NFKD Perform string comparison after s1 and s2 have been normalized by using Unicode Normalization Form KD. U8_STRCMP_NFKC Perform string comparison after s1 and s2 have been normalized by using Unicode Normalization Form KC. Only one case-sensitive or case-insensitive option is allowed. Only one Unicode Normalization option is allowed. version The version of Unicode data that should be used during comparison. The following values are supported: U8_UNICODE_320 Use Unicode 3.2.0 data during comparison. U8_UNICODE_500 Use Unicode 5.0.0 data during comparison. U8_UNICODE_LATEST Use the latest Unicode version data available, which is Unicode 5.0.0. errnum A non-zero value indicates that an error has occurred during comparison. The following values are supported: EBADF The specified option values are conflicting and cannot be supported. EILSEQ There was an illegal character at s1, s2, or both. EINVAL There was an incomplete character at s1, s2, or both. ERANGE The specified Unicode version value is not supported. DESCRIPTION
The u8_stcmp() function internally processes UTF-8 strings pointed to by s1 and s2 based on the corresponding version of the Unicode Stan- dard and other input arguments and compares the result strings in byte-by-byte, machine ordering. When multiple comparison options are specified, Unicode Normalization is performed after case-sensitive or case-insensitive processing is performed. RETURN VALUES
The u8_strcmp() function returns an integer greater than, equal to, or less than 0 if the string pointed to by s1 is greater than, equal to, or less than the string pointed to by s2, respectively. When u8_strcmp() detects an illegal or incomplete character, such character causes the function to set errnum to indicate the error. After- ward, the comparison is still performed on the resultant strings and a value based on byte-by-byte comparison is always returned. EXAMPLES
Example 1 Perform simple default string comparison. #include <sys/u8_textprep.h> int docmp_default(const char *u1, const char *u2) { int result; int errnum; result = u8_strcmp(u1, u2, 0, 0, U8_UNICODE_LATEST, &errnum); if (errnum == EILSEQ) return (-1); if (errnum == EINVAL) return (-2); if (errnum == EBADF) return (-3); if (errnum == ERANGE) return (-4); Example 2 Perform upper case based case-insensitive comparison with Unicode 3.2.0 date. #include <sys/u8_textprep.h> int docmp_caseinsensitive_u320(const char *u1, const char *u2) { int result; int errnum; result = u8_strcmp(u1, u2, 0, U8_STRCMP_CI_UPPER, U8_UNICODE_320, &errnum); if (errnum == EILSEQ) return (-1); if (errnum == EINVAL) return (-2); if (errnum == EBADF) return (-3); if (errnum == ERANGE) return (-4); return (result); } Example 3 Perform Unicode Normalization Form D. Perform Unicode Normalization Form D and upper case based case-insensitive comparison with Unicode 3.2.0 date. #include <sys/u8_textprep.h> int docmp_nfd_caseinsensitive_u320(const char *u1, const char *u2) { int result; int errnum; result = u8_strcmp(u1, u2, 0, (U8_STRCMP_NFD|U8_STRCMP_CI_UPPER), U8_UNICODE_320, &errnum); if (errnum == EILSEQ) return (-1); if (errnum == EINVAL) return (-2); if (errnum == EBADF) return (-3); if (errnum == ERANGE) return (-4); return (result); } ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Committed | +-----------------------------+-----------------------------+ |MT-Level |MT-Safe | +-----------------------------+-----------------------------+ SEE ALSO
u8_textprep_str(3C), u8_validate(3C), attributes(5), u8_strcmp(9F), u8_textprep_str(9F), u8_validate(9F) The Unicode Standard (http://www.unicode.org) SunOS 5.11 12 Sep 2007 u8_strcmp(3C)
All times are GMT -4. The time now is 02:47 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy