Sponsored Content
Full Discussion: help me in this part
Top Forums Shell Programming and Scripting help me in this part Post 302070164 by RTM on Sunday 2nd of April 2006 07:14:53 AM
Old 04-02-2006
Maybe you should either put more information in your question or post the script that you have questions about.
 

4 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help part 2

Ok well this isn't homework or classwork, I have been done with school for many years. I offered to help my co-worker who's daughter needs help. I didn't realize I had got rid of all of my UNIX books until after I agreed to help. (3 Replies)
Discussion started by: penguin123
3 Replies

2. Shell Programming and Scripting

comparing part of header with part of detailed records.

Hi there, I am lil confused with the following issue. I have a File, which has the following header: IMSHRATE_043008_101016 a sample detailed record is :9820101 A982005000CAVG030108000000000000010169000MAR 2008 9820102 MAR 2008 D030108 ... (1 Reply)
Discussion started by: cmaroju
1 Replies

3. Shell Programming and Scripting

[Solved] Printing a part of the last line of the specific part of a file

Hi, I have 80 large files, from which I want to get a specific value to run a Bash script. Firstly, I want to get the part of a file which contains this: Name =A xxxxxx yyyyyy zzzzzz aaaaaa bbbbbb Value = 57 This is necessary because in a file there are written more lines which... (6 Replies)
Discussion started by: wenclu
6 Replies

4. UNIX for Beginners Questions & Answers

How to make a loop to read the input from a file part by part?

Hi All, We've a VDI infrastructure in AWS (AWS workspaces) and we're planning to automate the process of provisioning workspaces. Instead of going to GUI console, and launching workspaces by selecting individual users is little time consuming. Thus, I want to create them in bunches from AWS CLI... (6 Replies)
Discussion started by: arun_adm
6 Replies
string(3)						     Library Functions Manual							 string(3)

NAME
strcat, strcmp, strcpy, strdup - Perform operations on strings LIBRARY
Standard C Library (libc.so, libc.a) SYNOPSIS
#include <string.h> char *strcat( char *s1, const char *s2); int strcmp( const char *s1, const char *s2); char *strcpy( char *s1, const char *s2); char *strdup( const char *s1); STANDARDS
Interfaces documented on this reference page conform to industry standards as follows: strcat(), strcmp(), strcpy(): XSH4.2 strdup(): XSH4.2 Refer to the standards(5) reference page for more information about industry standards and associated tags. PARAMETERS
In strcat(), specifies the destination string for appending; in strcmp(), specifies the first of two strings to compare; in strcpy(), spec- ifies the destination string for the copying; and in strdup(), specifies the string to be duplicated. In strcat(), specifies the string to be appended to s1; in strcmp(), specifies the second of two strings to compare; and in strcpy(), specifies the source string for the copy- ing. Note [Tru64 UNIX] If you pass a NULL pointer as one of the const char * or char * parameters of a string manipulation function, the function generates a segmentation violation. To avoid the segmentation violation and cause the function to return zero, change the NULL pointer treatment for the process before issuing the call to the string manipulation function, as follows: Include the system header file sys/uswitch.h. Call the uswitch function, as described in the uswitch(2) reference page. The following program illustrates this procedure: #include <stdio.h> #include <sys/types.h> #include <sys/uswitch.h> main() { size_t retval; int uswitch_val; uswitch_val = uswitch(USC_GET,0); uswitch(USC_SET, uswitch_val | USW_NULLP); retval = strdup(NULL); DESCRIPTION
The strcat() function appends a copy of the string pointed to by the s2 parameter (including the terminating null byte) to the end of the string pointed to by the s1 parameter. The initial byte of s2 overwrites the null byte at the end of the string pointed to by s1. When operating on overlapping strings, the behavior of this function is unreliable. The strcmp() function compares the string pointed to by the s1 parameter to the string pointed to by the s2 parameter. The sign of a nonzero value returned by strcmp() is determined by the sign of the difference between the values of the first pair of bytes (both inter- preted as unsigned char) that differ in the two compared objects. The strcmp() function compares strings based on the machine collating order. It does not use the locale-dependent sorting order. Use the strcoll() or wcscoll() functions for locale-dependent sorting. The strcpy() function copies the string pointed to by the s2 parameter (including the terminating null byte) to the location pointed to by the s1 parameter. When operating on overlapping strings, the behavior of this function is unreliable. The strdup() function returns a pointer to a new string that is an exact duplicate of the string pointed to by the s1 parameter. The mal- loc() function is used to allocate space for the new string. RETURN VALUES
On successful completion, the strcat(), strcpy(), and strdup() functions return a pointer to the resulting string. Otherwise, these func- tions return a null pointer. The strdup() function sets errno to indicate the error. On successful completion, the strcmp() function returns an integer whose value is greater than, equal to, or less than 0 (zero), according to whether the s1 string is greater than, equal to, or less than the s2 string. ERRORS
If the strdup() function fails, errno may be set to the following value: Insufficient storage space is available. RELATED INFORMATION
Functions: malloc(3), memccpy(3), setlocale(3), strchr(3), strcoll(3), strlen(3), strncasecmp(3), strncat(3), strncmp(3), strncpy(3), strp- brk(3), strspn(3), strtok(3), strstr(3), strxfrm(3), swab(3), uswitch(2), wcscat(3), wcscmp(3), wcscpy(3) Standards: standards(5) delim off string(3)
All times are GMT -4. The time now is 05:47 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy