Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

str_copy(3) [debian man page]

str_copy(3)						     Library Functions Manual						       str_copy(3)

NAME
str_copy - copy an ASCIIZ string SYNTAX
#include <str.h> size_t str_copy(char* out,const char* in); DESCRIPTION
str_copy copies the leading bytes of in to out up to and including the first occurrance of . str_copy returns the number of bytes copied. SEE ALSO
strlen(3) str_copy(3)

Check Out this Related Man Page

STRING(3)						     Library Functions Manual							 STRING(3)

NAME
string, strcat, strncat, strcmp, strncmp, strcpy, strncpy, strlen, index, rindex - string operations string, strcat, strncat, strcmp, strncmp, strcpy, strncpy, strlen, strchr, strrchr, strerror, memcmp, memcpy, memmove, memchr, memset, index, rindex - string operations SYNOPSIS
#include <sys/types.h> #include <strings.h> char *strcat(char *s1, const char *s2) char *strncat(char *s1, const char *s2, size_t n) int strcmp(const char *s1, const char *s2) int strncmp(const char *s1, const char *s2, size_t n) char *strcpy(char *s1, const char *s2) char *strncpy(char *s1, const char *s2, size_t n) size_t strlen(const char *s) char *strchr(const char *s, int c) char *strrchr(const char *s, int c) char *strerror(int errnum) int memcmp(const void *s1, const void *s2, size_t n) void *memcpy(void *s1, const void *s2, size_t n) void *memmove(void *s1, const void *s2, size_t n) void *memchr(const void *s, int c, size_t n) void *memset(void *s, int c, size_t n) char *index(const char *s, int c) char *rindex(const char *s, int c) DESCRIPTION
These functions operate on null-terminated strings. They do not check for overflow of any receiving string. Strcat appends a copy of string s2 to the end of string s1. Strncat copies at most n characters. Both return a pointer to the null-termi- nated result. Strcmp compares its arguments and returns an integer greater than, equal to, or less than 0, according as s1 is lexicographically greater than, equal to, or less than s2. Strncmp makes the same comparison but looks at at most n characters. Strcpy copies string s2 to s1, stopping after the null character has been moved. Strncpy copies exactly n characters, truncating or null- padding s2; the target may not be null-terminated if the length of s2 is n or more. Both return s1. Strlen returns the number of non-null characters in s. Strchr (strrchr) returns a pointer to the first (last) occurrence of character c in string s, or null if c does not occur in the string. Strerror returns the error string for the system call error errnum. See intro(2). Memcmp is like strcmp except that the strings are memory blocks of length n. Null characters are treated as ordinary characters. Memcpy copies n bytes from the location pointed to by s2 to s1. Memmove is like memcpy, except that it can handle overlap between the two strings. Both functions return s1. Memchr returns a pointer to the first occurrence of character c in string s, or null if c does not occur in the string. Memset sets n bytes to c starting at location s. It returns s. Index and rindex are obsolete versions of strchr and strrchr. New code should avoid using them. NOTES
Characters are compared as unsigned char, whether char itself is signed or not. 4th Berkeley Distribution May 15, 1985 STRING(3)
Man Page

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

insert pipe in file to separate values

hi all... i need your help, because i donīt know what to do... i have a flat file like this: B065200512312004123111010000061451 000021853 B065200512312004123111020000621907 000417802 B065200512312004123111030000005214 000005861 B065200512312004123111040000120133 000088448 and i need... (5 Replies)
Discussion started by: DebianJ
5 Replies

2. Shell Programming and Scripting

Help with pipes in a file

I have to add pipes for particualr number of records in a file. For eg the file has 10 records and i need to add the "|" for records numbers 7 to 10 at particular positons as shown. I need to add pipes in each of these records at positions 9, 11,,21 as like below. Can some body... (7 Replies)
Discussion started by: dsravan
7 Replies

3. Shell Programming and Scripting

Create two line from single line in shell

I wanted crate two lines by parsing one lin by exracting certian fields I have record line somthing like below (Origanal line before Parsing) DF02000XXYYYY00200.89ZZPPPP00800 Field discription : DF - FirstField (Character Position 1 to 2) 02000 - Second Field (Characters position 3 to... (2 Replies)
Discussion started by: unishiva
2 Replies

4. Shell Programming and Scripting

Parsing 286 length Character string

Hi Friends, I have .txt file which has 13000 records. Each record is 278 character long. I am using below code to extract the string and it takes almost 10 minutes. Any suggestion please. cat filename.txt|while read line do f1=`echo $line|awk '{print substr($1,1,9)}'` f2=`echo... (6 Replies)
Discussion started by: ppat7046
6 Replies

5. Shell Programming and Scripting

Split long record into csv file

Hi I receive a mainframe file which has very long records (1100 chars) with no field delimiters. I need to parse each record and output a comma delimited (csv) file. The record layout is fixed. If there weren't so many fields and records I would read the file into Excel, as a "fixed width"... (10 Replies)
Discussion started by: wvdeijk
10 Replies

6. Shell Programming and Scripting

Moving characters instead of fields with awk

Is there a simple way to select and replace characters based on character position in the line rather than as delimited columns? I have input $FILE.1 0.9318 1.4966 0.6361 A 0.4709 -0.2878 -0.5030 Bb -0.5738 -1.3981 0.8936 C And desire output $FILE.2 A ... (4 Replies)
Discussion started by: Alchemy3083
4 Replies

7. Shell Programming and Scripting

Program to insert Delimiters at fixed locations in a file, Can you please Debug it for me??

Can someone please help?I have a file - fixed.txt----------------------------AABBBBCCCCCCDDDEEFFFFGGGGGGHHHIIJJJJKKKKKKLLL----------------------------To insert delimiters at fixed lengths of 2, 4, 6, 3, I created a file text1.txt as-------------------2463----------------------and trying to execute... (10 Replies)
Discussion started by: jd_mca
10 Replies

8. Shell Programming and Scripting

awk - setting fs to equal any single character

Hi Does anyone know how to set any character as the field separator with awk/nawk on a solaris 10 box. I have tried using /./ regex but this doesnt work either and im out of ideas. thanks (7 Replies)
Discussion started by: chronics
7 Replies

9. Shell Programming and Scripting

switch values

Hi all, I am a relative novice with awk and am stuck on something I can't help thinking ought to be really simple. I have a file "mydata.txt" as below x 20 x 20 x x 45 x 45 x x 100 x 100 x x 50 x 50 x I am trying to write a simple script that will output... (17 Replies)
Discussion started by: hernand
17 Replies

10. Solaris

Specify the inode of a file?

Is there any way to create a file on Solaris 10 (ZFS preferably, but UFS would be helpful as well) with a specific inode number? I need to create a file with a large inode, greater than a 32bit integer. I am trying to test a piece of software which may be incorrectly truncating large inodes down... (16 Replies)
Discussion started by: unblockable
16 Replies