Sponsored Content
Top Forums UNIX for Advanced & Expert Users Forking a new process without parent dependance Post 302232717 by tyler_durden on Friday 5th of September 2008 03:45:09 AM
Old 09-05-2008
Thankx Era
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

forking and killing parent processes

Hi everybody, I'm having some problems wiriting a program in UNIX using the "fork" and "kill" system calls. I have to create a C program P0, which creates 9 other processes P1, P2, ..., P9, where P0 is the father of P1, P1 the father of P2, and so on. All the processes contain an infinite... (0 Replies)
Discussion started by: davewilliams20
0 Replies

2. Programming

forking a new process

Hi I'm currently working with C on UNIX (HPUX) and need to be able to fork a seperate Java process from within a running C process. I can run the following code from the command line via a script but am having difficulty getting it to work from within the code. I am trying to use execl. Is... (4 Replies)
Discussion started by: themezzaman
4 Replies

3. Programming

forking process.

#include <stdio.h> #include <sys/types.h> #include <unistd.h> int main() { pid_t pID; int i; for (i = 0; i < 3; i++) { pID = fork (); if (pID == 0) { printf ("Value of i --> %d... (2 Replies)
Discussion started by: kymthasneem
2 Replies

4. UNIX for Advanced & Expert Users

VERY confused about forking of child process

hi, I thought that when a child shell is forked, it will inherit all the variables of the parent now in my .cshrc I have setenv X x then I do at command line setenv X y and X is now y. So far so good! I then have a very simple script, y.csh #!/usr/bin/csh echo X (7 Replies)
Discussion started by: JamesByars
7 Replies

5. UNIX for Dummies Questions & Answers

Testing the forking process.

Hey, first time poster and a new UNIX user here. My question is regarding the forking process. I logged in to tty1, and typed the command ls -1 and hit enter. How can i tell that the ls -1 command ran in a subshell? Thanks. (0 Replies)
Discussion started by: Vitamin254
0 Replies

6. Shell Programming and Scripting

Forking a bunch of processes and filling up the process table

I have a bash script that has been used for months here at work for doing an SSH into other machines both Linux and Solaris and running a script on the remote machine. Recently I have started to noticed that things are being left being on the maching doing the SSH. For example.... tivoli ... (1 Reply)
Discussion started by: LRoberts
1 Replies

7. Shell Programming and Scripting

How to make the parent process to wait for the child process

Hi All, I have two ksh script. 1st script calls the 2nd script and the second script calls an 'C' program. I want 1st script to wait until the 'C' program completes. I cant able to get the process id for the 'C' program (child process) to make the 1st script to wait for the second... (7 Replies)
Discussion started by: sennidurai
7 Replies

8. Shell Programming and Scripting

[KSH/Bash] Starting a parent process from a child process?

Hey all, I need to launch a script from within 2 other scripts that can run independently of the two parent scripts... Im having a hard time doing this, if anyone knows how please let me know. More detail. ScriptA (bash), ScriptB (ksh), ScriptC (bash) ScriptA, launches ScriptB ScirptB,... (7 Replies)
Discussion started by: trey85stang
7 Replies

9. Programming

Parent forking

My question is, how do you fork only the parent processes in unix? For example how would I use the fork function to fork the parent process more than once and leave the children processes alone. This way I do not have children of children. The way I have it set up now it the parent process forks 3... (7 Replies)
Discussion started by: TWhitt24
7 Replies

10. Shell Programming and Scripting

forking a child process and kill its parent to show that child process has init() as its parent

Hi everyone i am very new to linux , working on bash shell. I am trying to solve the given problem 1. Create a process and then create children using fork 2. Check the Status of the application for successful running. 3. Kill all the process(threads) except parent and first child... (2 Replies)
Discussion started by: vizz_k
2 Replies
strptime(3)						     Library Functions Manual						       strptime(3)

NAME
strptime - Converts a character string to a time value LIBRARY
Standard C Library (libc.so, libc.a) SYNOPSIS
#include <time.h> char *strptime( const char *buf, const char *format, struct tm *tm); STANDARDS
Interfaces documented on this reference page conform to industry standards as follows: strptime(): XSH4.2 Refer to the standards(5) reference page for more information about industry standards and associated tags. PARAMETERS
Contains the character string to be converted by the strptime() function. Specifies the format of the string to be converted by the strp- time() function. Specifies the structure to contain the output of the strptime() function. DESCRIPTION
The strptime() function converts the characters pointed to by the buf parameter to values that are stored in the tm structure, using the format specified by the format parameter. The strptime() function modifies only the fields in the tm structure that have corresponding conversion specifications in the format. The format parameter can contain zero or more of the following items: A conversion specification that directs the conversion of the next input field. Conversion specifications start with a % (percent sign). Any white space character (as determined by the isspace() function) that matches 0 (zero) or more white space characters in the input stream. Any character except % (percent sign) or a white space character that must match the next character in the input stream. If the character read from the input stream is different from the character in the format parameter, the function stops processing the input stream and returns a null pointer. Conversion specifications must be separated by white-space or other non-alphanumeric characters. The following conversion specifications are supported: Inputs day of the week, using the locale-dependent weekday name. The abbreviated or full name may be specified. Same as %a. Inputs the month, using the locale-dependent month name. The abbreviated or full name may be specified. Same as %b. Inputs the date and time, using the locale-dependent default format. Inputs the century as a decimal number in the range from 00 to 99. Leading zeros are permitted but not required. Inputs the day of the month as a decimal number in the range from 01 to 31. Leading zeros are permitted but not required. Inputs the date as %m/%d/%y. Same as %d. [Tru64 UNIX] Inputs the year, using the locale-dependent Emperor/Era name and year format. Same as %b. Inputs the hour based on a 24-hour clock as a decimal number in the range from 00 to 23. Leading zeros are permitted but not required. Inputs the hour based on a 12-hour clock as a decimal number in the range from 00 to 12. Leading zeros are permitted but not required. Inputs the day number of the year as a decimal number in the range from 001 to 366. Leading zeros are permitted but not required. Inputs the month number as a decimal number in the range from 01 to 12. Leading zeros are permitted but not required. Inputs the minute as a decimal number in the range from 00 to 59. Leading zeros are permit- ted but not required. Inputs any white space up to and including a newline character. [Tru64 UNIX] Inputs the Emperor/Era name. [Tru64 UNIX] Inputs the Emperor/Era year. Inputs the locale-dependent equivalent of AM or PM. Inputs the 12-hour clock time with an AM/PM nota- tion as defined by the t_fmt_ampm statement (see locale(4) for details), or, by default, inputs the time as %I:%M:%S %p. Inputs the time as %H:%M. Inputs the second as a decimal number in the range from 00 to 61. Leading zeros are permitted but not required. Inputs any white-space up to and including a tab character. Inputs the time as %H:%M:%S. Inputs the week number of the year as a decimal number in the range from 00 to 53. Sunday is the first day of the week. Leading zeros are permitted but not required. Inputs the weekday as a deci- mal number in the range from 0 to 6. Sunday is the first day of the week. Leading zeros are permitted but not required. Inputs the week number of the year as a decimal number in the range from 00 to 53. Monday is the first day of the week. Leading zeros are permitted but not required. Inputs the date, using the locale-dependent short date format. Inputs the time, using the locale-dependent short time for- mat. Inputs the year (excluding the century). When a century is not otherwise specified (for example, with %C), values in the range 69-99 refer to years in the twentieth century (1969-1999, inclusive); values in the range 00-68 refer to years in the twenty-first century (2000 to 2068, inclusive). Leading zeros are permitted but not required. Inputs the year (including the century), for example, 1991. [Tru64 UNIX] Inputs the time-zone name. Inputs a % (percent sign) character. Case is ignored for the following conversion specifications when matching items such as month or weekday names in buf: %a, %A, %b, %B, %E, %h, %N, %p, and %r. Alternative-format Directives The E and O characters can be used with some of the directives to stipulate that an alternative format be used, if available. If the alternative format is not available in the current locale, the modifier will be ignored and the unmodified behavior for that directive will be followed. Inputs the date and time, using the locale-dependent alternative format. Inputs the base year (period), using the locale-dependent alter- native format. Inputs the date, using the locale-dependent alternative format. Inputs the time, using the locale-dependent alternative format. Inputs the year within the century, using the locale-dependent alternative format. Inputs the year (including the century), using the locale-dependent alternative format. Inputs the day of the month, using the locale-dependent alternative format. Leading zeros are permitted but not required. Same as %Od. Inputs the hour (24-hour clock), using the locale-dependent alternative format. Inputs the hour (12-hour clock), using the locale-dependent alternative format. Inputs the month number, using the locale-dependent alternative format. Inputs the minute, using the locale-dependent alternative format. Inputs the second, using the locale-dependent alternative format. Inputs the week number (Sunday as first day of week), using the locale-dependent alternative format. Inputs the number of the weekday (Sunday=0), using the locale-dependent alternative format. Inputs the week number (Monday as first day of week), using the locale-depen- dent alternative format. Inputs the year (offset from %C) in the locale-dependent alternative representation and using the locale-depen- dent alternative numeric symbols. A directive consisting of white-space characters is executed by reading input until reaching the first nonwhite-space character, which is not read, or until no more characters can be read. A directive consisting of an ordinary character is executed by reading the next character from the buf parameter. If the character read from the buf parameter differs from the character comprising the directive, the directive fails and the differing character and any charac- ters following it remain unread. Case is ignored when matching buf items, such as month or weekday names. If a conversion fails, the contents of the tm structure are undefined. In most cases, it is possible to use the same format in the strftime() and strptime() calls because most of the conversion specifications formats are identical in both functions. NOTES
Applications should use %Y (4-digit years) in preference to %y (2-digit years). RETURN VALUES
On successful completion, the strptime() function returns a pointer to the character following the last character parsed. Otherwise, a null pointer is returned. ERRORS
The strptime() function sets errno to the specified values for the following conditions: The functionality is not supported on this implementation. RELATED INFORMATION
Functions: scanf(3), strfmon(3), strftime(3), time(3) Standards: standards(5) delim off strptime(3)
All times are GMT -4. The time now is 09:31 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy