Sponsored Content
Top Forums UNIX for Dummies Questions & Answers How to write a script by fork() in unix Post 302131651 by porter on Monday 13th of August 2007 04:25:30 AM
Old 08-13-2007
Try this thread...https://www.unix.com/high-level-progr...#post302123714

fork() is system call, not part of shell scripting.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to write a Script to run series of batch jobs on unix platform

Im new to unix shell scripting, I have to run batch jobs on unix. for example i have 5 jobs. first 2 can kickoff parallely. after completely finishing the 2 previous jobs the 3 job should kick off..once 3rd is over 4 th and 5th can kick off parallely. Each jobs run for 1 or 2 hours each. How to... (2 Replies)
Discussion started by: venki311
2 Replies

2. Shell Programming and Scripting

how to write examination(multiple choice) script in unix

Hi, I am unable to get idea, how to write the script like multiple choice exam model script , how to specify the welcome to the exam(name) and if he select option then it has to enter into the exam , then choosing the answers,next question and going to previous question. Thanks & Regards ... (0 Replies)
Discussion started by: palreddy7
0 Replies

3. Programming

fork/exec clobbers write. I need ideas why...

On my *nix box, I have a telegram program. When I go like tel person "la\nla\nla\n" the person sees "la\nla\nla\n" However, when I have a program that forks and execs tel like: pid = fork(); if (pid < 0) { perror("fork failed"); exit(EXIT_FAILURE); } if (pid == 0) {... (7 Replies)
Discussion started by: frequency8
7 Replies

4. Shell Programming and Scripting

How to write a script by using unix commands to down any server

Hi, I need to do frequently server down and up. Every time i am using nearly 5 to 6 commands to down and agin i am using the commands to up. Can anybody help me to write a script to down and up. which i can use once on unix platform it can down later it can up the server. (1 Reply)
Discussion started by: sreerao
1 Replies

5. Shell Programming and Scripting

need help to understand and write script in fork

Can anybody help me for writing unix shell scripting on fork(); it will be appreciated, if any body can send me sample, tutorial ...with details. (5 Replies)
Discussion started by: manas_ranjan
5 Replies

6. UNIX for Dummies Questions & Answers

How can i use fork,sleep,wait and write in a process with father and son..??

Hi.. I was unable to do (gcc code) which refers to the fork,wait,sleep and write.. what i want to do: A process of father create (fork) a son and will sleep 90 seconds..After this, son process create a grandchild and will sleep 60 seconds..Grandchild process will sleep for 30 seconds..After... (3 Replies)
Discussion started by: gumlucin
3 Replies

7. Shell Programming and Scripting

Need to write a script to reformat a file in unix but not familiar with unix

unix script must do the fiollowing open a file containing comma delimited records > each record contains 10 fields > removes the 2nd field and use that same field containing fields 2 to 10 the original record after fprocessing should containing fields 1 and 3 a new erecord must be... (10 Replies)
Discussion started by: dwightja
10 Replies

8. Shell Programming and Scripting

How to write a script in unix to get value from SQR?

hi this is naga, i had created one SQR , but i didnt include the code to get the notification(failure or success ) thats way every time its returning the status=0 SQR was went to success(if it failed also), without touching the code of the SQR can any one help to write script in unix to get... (4 Replies)
Discussion started by: nagavenkatesh
4 Replies

9. Shell Programming and Scripting

How to write text file data to excel using UNIX shell script?

Hi All, I have the requirement in unix shell script. I want to write the "ls -ltr" command out put to excel file as below. Input :text file data : drwxr-xr-x 5 root root 4096 Oct 2 12:26 drwxr-xr-x 2 apx aim 4096 Nov 29 18:40 drwxr-xr-x 5 root root 4096 Oct 2 12:26 drwxr-xr-x... (10 Replies)
Discussion started by: Balasankar
10 Replies

10. Shell Programming and Scripting

Need a UNIX/perl script to read and write the data

Hi, I have on Designdocument in that information is stored with in tabular format.I need Perl/unix script to read and write the data using perl script? Regards, Ravi (4 Replies)
Discussion started by: toravi.pentaho
4 Replies
uuid(3pm)						User Contributed Perl Documentation						 uuid(3pm)

NAME
OSSP::uuid - OSSP uuid Perl Binding DESCRIPTION
OSSP uuid is a ISO-C:1999 application programming interface (API) and corresponding command line interface (CLI) for the generation of DCE 1.1, ISO/IEC 11578:1996 and RFC 4122 compliant Universally Unique Identifier (UUID). It supports DCE 1.1 variant UUIDs of version 1 (time and node based), version 3 (name based, MD5), version 4 (random number based) and version 5 (name based, SHA-1). Additional API bindings are provided for the languages ISO-C++:1998, Perl:5 and PHP:4/5. Optional backward compatibility exists for the ISO-C DCE-1.1 and Perl Data::UUID APIs. OSSP::uuid is the Perl binding to the OSSP uuid API. Three variants are provided: TIE-STYLE API The TIE-style API is a functionality-reduced wrapper around the OO-style API and intended for very high-level convenience programming: "use OSSP::uuid;" tie" my $uuid, 'OSSP::uuid::tie', $mode, ...;" "$uuid = [ $mode, ... ];" "print "UUID=$uuid ";" "untie $uuid;" OO-STYLE API The OO-style API is a wrapper around the C-style API and intended for high-level regular programming. "use OSSP::uuid;" "my $uuid = "new" OSSP::uuid;" "$uuid->"load"($name);" "$uuid->"make"($mode, ...);" "$result = $uuid->"isnil"();" "$result = $uuid->"compare"($uuid2);" "$uuid->"import"($fmt, $data_ptr);" "$data_ptr = $uuid->"export"($fmt);" "[(]$str[, $rc)] = $uuid->"error"();" "$ver = $uuid->"version"();" "undef $uuid;" Additionally, the strings "v1", "v3", "v4", "v5" and "mc" can be used in $mode and the strings "bin", "str", and "txt" can be used for $fmt. C-STYLE API The C-style API is a direct mapping of the OSSP uuid ISO-C API to Perl and is intended for low-level programming. See uuid(3) for a description of the functions and their expected arguments. "use OSSP::uuid qw(:all);" "my $uuid; $rc = "uuid_create"($uuid);" "$rc = "uuid_load"($uuid, $name);" "$rc = "uuid_make"($uuid, $mode, ...);" "$rc = "uuid_isnil"($uuid, $result);" "$rc = "uuid_compare"($uuid, $uuid2, $result);" "$rc = "uuid_import"($uuid, $fmt, $data_ptr, $data_len);" "$rc = "uuid_export"($uuid, $fmt, $data_ptr, $data_len);" "$str = "uuid_error"($rc);" "$ver = "uuid_version"();" "$rc = "uuid_destroy"($uuid);" Additionally, the following constants are exported for use in $rc, $mode, $fmt and $ver: "UUID_VERSION", "UUID_LEN_BIN", "UUID_LEN_STR", "UUID_RC_OK", "UUID_RC_ARG", "UUID_RC_MEM", "UUID_RC_SYS", "UUID_RC_INT", "UUID_RC_IMP", "UUID_MAKE_V1", "UUID_MAKE_V3", "UUID_MAKE_V4", "UUID_MAKE_V5", "UUID_MAKE_MC", "UUID_FMT_BIN", "UUID_FMT_STR", "UUID_FMT_SIV", "UUID_FMT_TXT". EXAMPLES
The following two examples create the version 3 UUID "02d9e6d5-9467-382e-8f9b-9300a64ac3cd", both via the OO-style and the C-style API. Error handling is omitted here for easier reading, but has to be added for production-quality code. # TIE-style API (very high-level) use OSSP::uuid; tie my $uuid, 'OSSP::uuid::tie'; $uuid = [ "v1" ]; print "UUIDs: $uuid, $uuid, $uuid "; $uuid = [ "v3", "ns:URL", "http://www.ossp.org/" ]; print "UUIDs: $uuid, $uuid, $uuid "; untie $uuid; # OO-style API (high-level) use OSSP::uuid; my $uuid = new OSSP::uuid; my $uuid_ns = new OSSP::uuid; $uuid_ns->load("ns:URL"); $uuid->make("v3", $uuid_ns, "http://www.ossp.org/"); undef $uuid_ns; my $str = $uuid->export("str"); undef $uuid; print "$str "; # C-style API (low-level) use OSSP::uuid qw(:all); my $uuid; uuid_create($uuid); my $uuid_ns; uuid_create($uuid_ns); uuid_load($uuid_ns, "ns:URL"); uuid_make($uuid, UUID_MAKE_V3, $uuid_ns, "http://www.ossp.org/"); uuid_destroy($uuid_ns); my $str; uuid_export($uuid, UUID_FMT_STR, $str, undef); uuid_destroy($uuid); print "$str "; SEE ALSO
uuid(1), uuid-config(1), uuid(3). HISTORY
The Perl binding OSSP::uuid to OSSP uuid was implemented in November 2004 by Ralf S. Engelschall <rse@engelschall.com>. perl v5.14.2 2007-01-01 uuid(3pm)
All times are GMT -4. The time now is 05:28 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy