Sponsored Content
Top Forums Shell Programming and Scripting Sequential Function Execution Post 302887587 by RudiC on Sunday 9th of February 2014 06:48:15 AM
Old 02-09-2014
Unless you call funcx from within funcy, there's no chance they execute simultaneously in a single process. Or are you talking of multiple processes?
 

10 More Discussions You Might Find Interesting

1. Programming

Reading special characters while converting sequential file to line sequential

We have to convert a sequential file to a 80 char line sequential file (HP UX platform).The sequential file contains special characters. which after conversion of the file to line sequential are getting coverted into "new line" or "tab" and file is getting distorted. Is there any way to read these... (2 Replies)
Discussion started by: Rajeshsu
2 Replies

2. Shell Programming and Scripting

Sequential execution of job in cron

Hi I have a file say xyz.sh, whose contents are as follows : *************************** #! /bin/ksh set -x . /a.sh . /b.sh . /c.sh ***************************** Now will this execute all the three process simultaneously or sequentially? If it will process simultaneously, is... (3 Replies)
Discussion started by: pankajkrmishra
3 Replies

3. UNIX for Dummies Questions & Answers

Sequential execution in shell script?

I've a shell script that invokes a URL of an application to do some work, e.g., http://www.abc.com/myservlet?action=helloworld.Does the shell wait for a return value from the URL call before proceeding to the next line of command? (6 Replies)
Discussion started by: chengwei
6 Replies

4. Shell Programming and Scripting

Expect Issue Serial Forground Execution vs Concurrent Background Execution

I have an expect script that interrogates several hundred unix servers for both access and directories therein using "ssh user@host ls -l /path". The combination of host/path are unique but the host may be interrogated multiple times if there are multiple paths to test. The expect script is run... (2 Replies)
Discussion started by: twk
2 Replies

5. Shell Programming and Scripting

sequential to line sequential

Hi I have a file sequential way i.e. written in contineous mode and the Record Seperator is AM from which the record is seperated .Now to process I have to make line sequential,and more over record length is not same it varies as per the input address, AM1234563 John Murray 24 Old streeet old... (5 Replies)
Discussion started by: vakharia Mahesh
5 Replies

6. Programming

Tool to simulate non-sequential disk I/O (simulate db file sequential read) in C POSIX

Writing a Tool to simulate non-sequential disk I/O (simulate db file sequential read) in C POSIX I have over the years come across the same issue a couple of times, and it normally is that the read speed on SAN is absolutely atrocious when doing non-sequential I/O to the disks. Problem being of... (7 Replies)
Discussion started by: vrghost
7 Replies

7. Shell Programming and Scripting

Sequential numbers

Hi All, I am looking for a simple way to write numbers to a file sequentially starting from 1 and ending on a specified upper limit. Example of the output file is below Example 1 2 3 4 5 . . . . 1000 please let me know the best way to do it. (10 Replies)
Discussion started by: Lucky Ali
10 Replies

8. Shell Programming and Scripting

Sequential execution of commands in ksh

I need to run few commands in a ksh script sequentially. Some of the commands are jobs submitted to the server and the consecutive commands are dependent on the completion of the jobs submitted to the server. It works if i separate the commands into different files like this #!/bin/ksh... (1 Reply)
Discussion started by: prashob123
1 Replies

9. Shell Programming and Scripting

Function command execution from root

I have a function hello, that is echoing i have put that function in .bash1 file then recalling the function with same user but with su command but it is not working. username -> test function -> below function save in .bash1 function hello() { echo "Hello, $1!" } export -f hello I... (2 Replies)
Discussion started by: learnbash
2 Replies

10. UNIX for Beginners Questions & Answers

Variable gets auto updated after function execution

Hi Team In the below code, irrespective of the if statement that gets executed, retcd is being assigned a standard value(1) instead of changing as per code. Could you please help to see where is it going wrong. rval=0 CONF_FILE=/apps/wmroot/scripts/props/UMPath.properties NOHUP="nohup"... (3 Replies)
Discussion started by: harishshankar
3 Replies
flock(2)							System Calls Manual							  flock(2)

Name
       flock - apply or remove an advisory lock on an open file

Syntax
       #include <sys/file.h>

       #define	 LOCK_SH   1	/* shared lock */
       #define	 LOCK_EX   2	/* exclusive lock */
       #define	 LOCK_NB   4	/* don't block when locking */
       #define	 LOCK_UN   8	/* unlock */

       flock(fd, operation)
       int fd, operation;

Description
       The  system  call applies or removes an advisory lock on the file associated with the file descriptor, fd.  A lock is applied by specifying
       an operation parameter that is the inclusive OR of LOCK_SH or LOCK_EX and, possibly, LOCK_NB.  To unlock an existing lock, operation should
       be LOCK_UN.

       Advisory  locks allow cooperating processes to perform consistent operations on files, but do not guarantee consistency; that is, processes
       might still access files without using advisory locks, possibly resulting in inconsistencies.

       The locking mechanism allows two types of locks: shared locks and exclusive locks.  At any time, multiple shared locks can be applied to  a
       file.  However, multiple exclusive locks, or shared and exclusive locks cannot be applied simultaneously on a file.

       A  shared  lock can be upgraded to be an exclusive lock, and an exclusive lock can become shared, simply by specifying the appropriate lock
       type. This change results in the previous lock being released and the new lock applied. When upgrading, do not include  LOCK_NB	in  opera-
       tion, because there is a possibility that other processes have requests for locks, or have gained or released a lock.

       Requesting  a lock on an object that is already locked normally causes the caller to blocked until the lock can be acquired.  If LOCK_NB is
       included in operation, the call is not blocked; instead, the call fails and the error EWOULDBLOCK is returned.

       Locks are on files, not file descriptors.  That is, file descriptors duplicated through or call do not result in multiple  instances  of  a
       lock,  but  rather  multiple references to a single lock.  If a process holding a lock on a file forks and the child explicitly unlocks the
       file, the parent loses its lock.

       Processes blocked awaiting a lock may be awakened by signals.

Return Values
       Zero is returned if the operation was successful; on an error, a -1 is returned and an error code is stored in the global variable, errno.

Diagnostics
       The call fails under the following conditions:

       [EWOULDBLOCK]  The file is locked and the LOCK_NB option was specified.

       [EBADF]	      The argument fd is an invalid descriptor.

       [EINVAL]       The argument fd refers to an object other than a file.

       [EOPNOTSUPP]   Invalid operation is requested.  The argument fd refers to a socket.

Restrictions
       File region locking is not supported over NFS.

See Also
       close(2), dup(2), execve(2), fork(2), open(2)

																	  flock(2)
All times are GMT -4. The time now is 03:50 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy