Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

strsep(9) [suse man page]

STRSEP(9)						     Basic C Library Functions							 STRSEP(9)

NAME
strsep - Split a string into tokens SYNOPSIS
char * strsep(char ** s, const char * ct); ARGUMENTS
s The string to be searched ct The characters to search for DESCRIPTION
strsep updates s to point after the token, ready for the next call. It returns empty tokens, too, behaving exactly like the libc function of that name. In fact, it was stolen from glibc2 and de-fancy-fied. Same semantics, slimmer shape. ;) COPYRIGHT
Kernel Hackers Manual 2.6. July 2010 STRSEP(9)

Check Out this Related Man Page

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

NAME
strsep - extract token from string SYNOPSIS
#include <string.h> char *strsep(char **stringp, const char *delim); Feature Test Macro Requirements for glibc (see feature_test_macros(7)): strsep(): _BSD_SOURCE DESCRIPTION
If *stringp is NULL, the strsep() function returns NULL and does nothing else. Otherwise, this function finds the first token in the string *stringp, where tokens are delimited by symbols in the string delim. This token is terminated with a '' character (by overwriting the delimiter) and *stringp is updated to point past the token. In case no delimiter was found, the token is taken to be the entire string *stringp, and *stringp is made NULL. RETURN VALUE
The strsep() function returns a pointer to the token, that is, it returns the original value of *stringp. CONFORMING TO
4.4BSD. NOTES
The strsep() function was introduced as a replacement for strtok(3), since the latter cannot handle empty fields. However, strtok(3) con- forms to C89/C99 and hence is more portable. BUGS
Be cautious when using this function. If you do use it, note that: * This function modifies its first argument. * This function cannot be used on constant strings. * The identity of the delimiting character is lost. SEE ALSO
index(3), memchr(3), rindex(3), strchr(3), strpbrk(3), strspn(3), strstr(3), strtok(3) COLOPHON
This page is part of release 3.25 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
2009-01-16 STRSEP(3)
Man Page

7 More Discussions You Might Find Interesting

1. Programming

need help in implementing simple interactive shell in C

hello all, i hv attached herewith my program to implement a simple interactive shell in C. no matter hw hard I try, I keep getting some errors. i need help - urgently !! proj1test7.c: In function `parseCommand': proj1test7.c:102: warning: assignment makes pointer from integer without a cast... (2 Replies)
Discussion started by: nix1209
2 Replies

2. Programming

make[1] *** [libsupp.a] Error 255

I have searched google and these forums as well. I am trying to compile proftpd on a vanilla Solaris 10 server and I am getting an error when I try to 'make' Server - Solaris 10 update 4 Installed packages from sunfreeware.com autoconf-2.60-sol10-sparc-local... (2 Replies)
Discussion started by: jjsoladmin
2 Replies

3. Shell Programming and Scripting

HI Newbi in Unix (spanish)

Mi idea es crear un pequeña shell...lo que pasa es que cuando ejecuto el siguiente programa va todo bien hasta que me salta el error perror("Error al ejecutar la función execvp\n"); Entonces la aplicación me entra en un bucle(repitiendo todo el rato el error anterio), como puedo hacer para que eso no... (1 Reply)
Discussion started by: isnhatar
1 Replies

4. Programming

Tokenistring a string in C++

Hi I have a string like "12;13;14|aa = 14;bb = 15" I have to store the values 12,13 and 14 in a list. and aa,bb in another list. Can anyone suggest me how to perform this in c++? :confused: Use code tags please, see PM. (2 Replies)
Discussion started by: rkrish
2 Replies

5. Programming

Fscanf to get number and replace.

Hi, I have a file with contents like "abcd 1234" .What i need is get that integer and replace that with 0. So i used fscanf(fp,"%s %d", str, &num); This is having some problem. There can be multiple space/tab between string and number. How to replace that number with 0 in same file? (4 Replies)
Discussion started by: explore
4 Replies

6. Programming

Wildcard Pattern Matching In C

I've been having problems lately trying to do pattern matching in C while implementing wildcards. Take for instance the following code: #include <sys/types.h> #include <sys/stat.h> #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <dirent.h> #include <string.h> ... (14 Replies)
Discussion started by: Azrael
14 Replies

7. UNIX for Beginners Questions & Answers

NTP synchronised problem in our Centos 7.6 node

Someone, please help on this issue:- Note : for security reason i didn't mention hostnames and ips. ============================================================================== # ntpstat unsynchronised polling server every 1024 s Ntpstat showing unsynchronised. ... (29 Replies)
Discussion started by: shanmugaraj
29 Replies