You have to stop people from using your count file at the same time. Not knowing your system I use a fifo as a sem, you have to succeed in creating it before you can read or write the count file. Not ideal, and someone could DOS it(leave junk in /tmp/script-fifo so everyone waits forever). A database of some sort would be better but I have no idea what you have.
/path/to/countfile must be a file which is writable by anyone running the script.
Hi all, I have a php file that grabs xml, parses it and updates my db accordingly. I want to automate the execution of this process, rather than having to hit the url manually.
I have been looking into using cron to execute a script to do this, however i'm not exactly sure what command i would... (1 Reply)
Hello All,
I have come across a small problem. It would be great if any of you could help me in resolving the issue.
one file named dummy.txt will be ftped to Unix machine twice daily. If i receive it second time in a day i need to do some processing with the file.
How to find the... (2 Replies)
consider this as a csv file.
H,0002,0002,20100218,17.25,P,barani
D,1,2,3,4,5,6,7,8,9,10,11
D,1,2,3,4,5,6,7,8,9,10,11
D,1,2,3,4,5,6,7,8,9,10,11
D,1,2,3,4,5,6,7,8,9,10,11
D,1,2,3,4,5,6,7,8,9,10,11
T,5
N
i want to read the csv file and count the number of rows that start with D and... (11 Replies)
Hi all:
Trying to count the number of oracle instances on HPUX 11.23 - using ksh. I have multiple instances running and I would like to have a count for how many processes for each instance. Example, run the 'ps -efu oracle' command and for each instance increment a counter. So I am looking for... (4 Replies)
HI All,
I have a CSV file of 30 columns separated by ,. I want to get a count of all unique rows written to a flat file. The CSV file is around 5000 rows
The first column is a time stamp and I need to exclude while counting unique
Thanks,
Ravi (4 Replies)
HI,
I need to print the record count of a file using shell script.
If the record count of a file excluding header and trailer record if greater than zero then print 'Record count of a file is xxxx records'.
If the record count is zero print 'zero records'
Thanks
Mahendra (1 Reply)
Hi,
I have files in the directory like below which I need to validate if all the required files are present.
A_B_001 of 002_time1.txt
A_B_002 of 002_time1.txt
A_B_001 of 001_time2.txt
Scenarios-
a)If file with 001 of 002_time1 or 002 of 002_time1 is missing in the folder,script should... (6 Replies)
I have file listed in my directory in following format
-rwxrwxr-x+ 1 test test 4.9M Oct 3 16:06 test20141002150108.txt
-rwxrwxr-x+ 1 test test 4.9M Oct 4 16:06 test20141003150108.txt
-rwxrwxr-x+ 1 test test 4.9M Oct 5 16:06 test20141005150108.txt
-rwxrwxr-x+ 1 test ... (2 Replies)
Hi all;
Here is my file:
V1.3=4
V1.4=5
V1.1=3
V1.2=6
V1.3=6
Please, can you help me to write a script shell that counts the sum of values in my file (4+5+3+6+6) ?
Thank you so much for help.
Kind regards. (3 Replies)
Discussion started by: chercheur111
3 Replies
LEARN ABOUT OPENDARWIN
mkfifo
MKFIFO(2) BSD System Calls Manual MKFIFO(2)NAME
mkfifo -- make a fifo file
SYNOPSIS
#include <sys/types.h>
#include <sys/stat.h>
int
mkfifo(const char *path, mode_t mode);
DESCRIPTION
Mkfifo() creates a new fifo file with name path. The access permissions are specified by mode and restricted by the umask(2) of the calling
process.
The fifo's owner ID is set to the process's effective user ID. The fifo's group ID is set to that of the parent directory in which it is
created.
RETURN VALUES
A 0 return value indicates success. A -1 return value indicates an error, and an error code is stored in errno.
ERRORS
Mkfifo() will fail and no fifo will be created if:
[EOPNOTSUPP] The kernel has not been configured to support fifo's.
[ENOTDIR] A component of the path prefix is not a directory.
[ENAMETOOLONG] A component of a pathname exceeded {NAME_MAX} characters, or an entire path name exceeded {PATH_MAX} characters.
[ENOENT] A component of the path prefix does not exist.
[EACCES] Search permission is denied for a component of the path prefix.
[ELOOP] Too many symbolic links were encountered in translating the pathname.
[EROFS] The named file resides on a read-only file system.
[EEXIST] The named file exists.
[ENOSPC] The directory in which the entry for the new fifo is being placed cannot be extended because there is no space left on the
file system containing the directory.
[ENOSPC] There are no free inodes on the file system on which the fifo is being created.
[EDQUOT] The directory in which the entry for the new fifo is being placed cannot be extended because the user's quota of disk
blocks on the file system containing the directory has been exhausted.
[EDQUOT] The user's quota of inodes on the file system on which the fifo is being created has been exhausted.
[EIO] An I/O error occurred while making the directory entry or allocating the inode.
[EIO] An I/O error occurred while reading from or writing to the file system.
[EFAULT] Path points outside the process's allocated address space.
SEE ALSO chmod(2), stat(2), umask(2)STANDARDS
The mkfifo function call conforms to IEEE Std 1003.1-1988 (``POSIX.1'').
BSD June 4, 1993 BSD