I wrote a simple program to have cat pipe its output into less through a FIFO. The write works fine, but the child won't exit after writing to the FIFO. Another program needs to read from the FIFO for it to exit, but the parent (less) must wait for the data to become available to read the FIFO. So essentially, I have a deadlock.
Here's the code:
I just want to know how I can have one program write to a FIFO through its standard output and the other program read from the FIFO through its standard input.
Also, I can't use anonymous pipes, due to losing control over I/O at the exec.
---------- Post updated at 06:11 PM ---------- Previous update was at 06:06 PM ----------
Problem solved. I changed the parent to call wait() after opening the FIFO on standard input.
I have unix sco server. I have created one application for client server communication. On this I have creted some fifos/pipes.
The reader.123 fifo is used by one process for reading and writing. I haven't deleted that fifo. But ls or find command doesn't show it. It is giving error as file or... (1 Reply)
Generally, most people, I guess, go from 5.3 ML4 Directly to TL 7. So they may never run into this issue.
For the rest of us, here is the resolution of my problem in going from ML6 to TL7.
Apparently with the change from ML to TL IBM added a "BuildDate Verification" routine into... (1 Reply)
Hello,
Going through book, "Guide to UNIX Using Linux". I am doing one of the projects that has me writing scripts to join files. Here is my pnumname script and I am extracting the programmers names and numbers from the program file and redirecting the output to the file pnn. I then created a... (0 Replies)
Hi,
This is the script that am trying to execute.
a= sar 1 5 | grep ^A | awk '{print $5}'
echo $a
i am getting output.
99
i get a blank space for echo $a.
Why is the value not getting assigned to a??
Thanks in Advance.
How to use code tags (6 Replies)
Hi
I want to make a script . In this script i want to use input file and this input file consist of three numbers in a line
for example input file is as below:
919876543210 09876543234567876 98764534245678 aircelmms","aircelweb","aircelwap"
096574235625... (2 Replies)
hi All,
I am using the command
find /home/mqm/check/ -mtime +1|wc -l
to get a count of the files older than a day under the check directory. But instead of getting the count of the files under check directory I m getting a count including the check directory itself. Can someone please tell... (0 Replies)
Hi,
I'm new to sh scripting and have the following problem. I have a script to sftp that is now working with ssh key. But i need to change this, i wan't to sftp with a password. I have the following script, tried a lot to make a variabel for the password. But i can't make it work
... (2 Replies)
Hi,
i have a problem with this script:
for i in $(cat list_ip_switch)
do
if
if ; then
echo "found ip"
else
echo "not found ip"
fi
done
cat list_ip_switch
10.155.249.171
10.155.249.172 (3 Replies)
I facing a problem :
I have a Source and Destination directory. The Source directory is linked to SVN and is updated by the Script to Head Revision.
After that i copy the Source to Destination by this command:
cp -r /SOURCE PATH /DESTIUNATION PATH
Now if a delete a file in source and... (5 Replies)
Discussion started by: ankur328
5 Replies
LEARN ABOUT HPUX
mkfifo
mkfifo(3C)mkfifo(3C)NAME
mkfifo() - make a FIFO file
SYNOPSIS DESCRIPTION
creates a new FIFO (first-in-first-out) file, at the path name to which path points. The file permission bits of the new file are initial-
ized from the mode argument, as modified by the process's file creation mask: for each bit set in the process's file mode creation mask,
the corresponding bit in the new file's mode is cleared (see umask(2)). Bits in mode other than the file permission bits are ignored.
The FIFO owner ID is set to the process's effective-user-ID. The FIFO group ID is set to the group ID of the parent directory if the set-
group-ID bit is set on that directory. Otherwise the FIFO group ID is set to the process's effective group ID.
For details of the I/O behavior of pipes see read(2) and write(2).
The following symbolic constants are defined in the header, and should be used to construct the value of the mode argument. The value
passed should be the bitwise inclusive OR of the desired permissions:
Read by owner.
Write by owner.
Read by group.
Write by group.
Read by other users.
Write by other users.
RETURN VALUE
returns 0 upon successful completion. Otherwise, it returns -1, no FIFO is created, and is set to indicate the error.
ERRORS
fails and the new file is not created if any of the following conditions are encountered:
[EACCES] A component of the path prefix denies search permission.
[EEXIST] The named file already exists.
[EFAULT] The path argument points outside the process's allocated address space. The reliable detection of this error is
implementation dependent.
[ELOOP] Too many symbolic links encountered in translating the path name.
[ENAMETOOLONG] The length of the specified path name exceeds bytes, or the length of a component of the path name exceeds bytes
while is in effect.
[ENOENT] A component of the path prefix does not exist.
[ENOENT] The path argument is null.
[ENOSPC] Not enough space on the file system.
[ENOTDIR] A component of the path prefix is not a directory.
[EROFS] The directory in which the file is being created is located in a read-only file system.
AUTHOR
was developed by HP.
SEE ALSO chmod(2), mknod(2), pipe(2), stat(2), umask(2), mknod(5), stat(5), thread_safety(5), types(5).
STANDARDS CONFORMANCE mkfifo(3C)