Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

rindex(3) [redhat man page]

INDEX(3)						     Linux Programmer's Manual							  INDEX(3)

NAME
index, rindex - locate character in string SYNOPSIS
#include <strings.h> char *index(const char *s, int c); char *rindex(const char *s, int c); DESCRIPTION
The index() function returns a pointer to the first occurrence of the character c in the string s. The rindex() function returns a pointer to the last occurrence of the character c in the string s. The terminating NULL character is considered to be a part of the strings. RETURN VALUE
The index() and rindex() functions return a pointer to the matched character or NULL if the character is not found. CONFORMING TO
BSD 4.3 SEE ALSO
memchr(3), strchr(3), strpbrk(3), strrchr(3), strsep(3), strspn(3), strstr(3), strtok(3) GNU
1993-04-12 INDEX(3)

Check Out this Related Man Page

INDEX(3)						     Linux Programmer's Manual							  INDEX(3)

NAME
index, rindex - locate character in string SYNOPSIS
#include <strings.h> char *index(const char *s, int c); char *rindex(const char *s, int c); DESCRIPTION
The index() function returns a pointer to the first occurrence of the character c in the string s. The rindex() function returns a pointer to the last occurrence of the character c in the string s. The terminating null byte ('') is considered to be a part of the strings. RETURN VALUE
The index() and rindex() functions return a pointer to the matched character or NULL if the character is not found. CONFORMING TO
4.3BSD; marked as LEGACY in POSIX.1-2001. POSIX.1-2008 removes the specifications of index() and rindex(), recommending strchr(3) and str- rchr(3) instead. SEE ALSO
memchr(3), strchr(3), string(3), strpbrk(3), strrchr(3), strsep(3), strspn(3), strstr(3), strtok(3) COLOPHON
This page is part of release 3.44 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/. GNU
2011-09-21 INDEX(3)
Man Page

11 More Discussions You Might Find Interesting

1. Linux

How I will check wheather my linux benchmark results are OK

My system bench mark results INDEX VALUES TEST BASELINE RESULT INDEX Arithmetic Test (type = double) 2541.7 876123.7 344.7 Dhrystone 2 without register variables 22366.3 5411602.3 ... (1 Reply)
Discussion started by: chandra s
1 Replies

2. Shell Programming and Scripting

reading a string characterwise

hi , I am trying to read two strings character by character using arrays but i couldn't do it pls.give a solution (2 Replies)
Discussion started by: akmtcs
2 Replies

3. Shell Programming and Scripting

Help with perl scripting on strings

Hai, I have strings as follows. 0 INDEX MODE: ANALYZED (UNIQUE SCAN) OF 'SYS_C0030166' (INDEX (UNIQUE)) 1 INDEX MODE: ANALYZED (UNIQUE SCAN) OF 'SYS_C0029845' (INDEX (UNIQUE) 9 INDEX MODE: ANALYZED (RANGE SCAN) OF ... (2 Replies)
Discussion started by: sagarbsa
2 Replies

4. Linux

word substitution in unix

Hi I am trying to substitute 2 words on the same line with _S02 as suffix. Like this . IN "TSOPS09" INDEX IN "TSOPIX09" ; to IN "TSOPS09_S02" INDEX IN "TSOPIX09_S02" ; i used the following code to make the change , it works fine for first substitution not the second one . ... (6 Replies)
Discussion started by: capri_drm
6 Replies

5. Linux

sed usage

Hi , I have a question. How do I replace 2 words in one line like this IN CLO07 INDEX IN CLOIX07 to IN CLO07_S02 INDEX IN CLOIX07_S02 But one thing to remember is that there are lots of words like CLODM001 . So the only matching pattern is "IN CLO" sample file... (4 Replies)
Discussion started by: capri_drm
4 Replies

6. UNIX for Dummies Questions & Answers

Getting strings before and after a character

OK This one has me stumped. I have the following line, program name - the program description that can also contain a hyphen - character. I'm need to separate the "program name" from the program description. I've tried using an array function with the - as delimiter, but I ran into a... (2 Replies)
Discussion started by: ricksj
2 Replies

7. Shell Programming and Scripting

what's wrong with that loop ?

hello everybody, here's my code mkf () { INDEX=0; while ; do touch "file$1.f"; INDEX=$INDEX+1; done } when I type mkf 10 the loop seems to act infinite and only the last file of the loop is created, in the example below, there just is file10.f in... (11 Replies)
Discussion started by: Oddant
11 Replies

8. Shell Programming and Scripting

remove the first and last character of a string

How can i remove the first and last character of strings like below: "^^^613*" "admt130" "^^^613*" "123456" "adg8484" "DQitYV09dh1C" Means i wanna remove the quotes(""). Please help (17 Replies)
Discussion started by: proactiveaditya
17 Replies

9. Programming

Convert Bash script to C

dear all, i need your advice for convert bash shell to C programming INDEX=/zpool1/NFS/INDEX/${1} SCRIPT=/zpool1/NFS/script/${1} LIST=SAMPLE cd ${SCRIPT} for i in `cat ${LIST}` do GETDATE=`echo ${i}|awk '{print substr($1,9,8)}'` /usr/xpg4/bin/awk -F ":" '{close(f);f=$4}{print >>... (2 Replies)
Discussion started by: zvtral
2 Replies

10. Shell Programming and Scripting

AWK Too many open streams to print/printf

hallow all i need your advice about this script i have script like this: INDEX=/zpool1/NFS/INDEX/${1} SCRIPT=/zpool1/NFS/script/${1} LIST=SAMPLE cd ${SCRIPT} for i in `cat ${LIST}` do GETDATE=`echo ${i}|awk '{print substr($1,9,8)}'` /usr/xpg4/bin/awk -F ":" '{close(f);f=$4}{print >>... (4 Replies)
Discussion started by: zvtral
4 Replies

11. HP-UX

Ignite-UX INDEX file messed up, how to recreate?

OK, so I just messed myself up. Thinking the /var/opt/ignite/data/INDEX files was static, I manually edited the file and added 2 more OS's to it. During an Install it only showed the first OS (started with 11.31, 3 versions then added a 11.23, and a 11.11 stanza's). The 11.23 and 11.11 never... (2 Replies)
Discussion started by: mrmurdock
2 Replies