08-17-2006
If you have opened the pipe via pipe system cmd then you must have access to 2 file descriptors which are read and write ends for pipe. You can write on the write end of pipe using the 'write' system call.
A better help would be
Beej's guide for IPC.
regards
Apoorva Kumar
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
anybody can help, plz:
I want to pass the output of "ls" to "grep":
ftp -n host <<!
USER user passwd
ls
bye
! | grep file
exit 0
It does not work!!
Any idea??
Sami (7 Replies)
Discussion started by: sami98
7 Replies
2. UNIX for Dummies Questions & Answers
I am using grep and I want the output to go into two files without going to the screen. I used tee to get the output into two files, but it is also putting the output on the screen which i do not want. Can this be fixed. (2 Replies)
Discussion started by: NobluesFDT
2 Replies
3. Shell Programming and Scripting
I have access to an AIX 5.3 box, where I need to write a report to:
/tmp/report
The report is larger then the amount of available disk space on the box.
There's about 1 GB of free space, for a 1.5 GB report.
The report is destined for another box (10.0.0.2) anyway, which has enough free... (2 Replies)
Discussion started by: mirx
2 Replies
4. UNIX for Dummies Questions & Answers
Hi,
I am having a list of directories with different login id's. My requirement is that i need to list the directories of my id and need to delete them. So i am using following code
ls -ltr ¦ grep userid ¦ rm -rf
But this is not working. So is there any way of doing it. Please note... (3 Replies)
Discussion started by: sarbjit
3 Replies
5. UNIX for Dummies Questions & Answers
I can use pipe output to a file. For example
./somescript.sh > output.txt
But for example if the output from ./somescript.sh is slow. like if it prints one line every minute then output.txt is not updated every minute. Lines are written to output.txt in one go, hence have to wait for the whole... (2 Replies)
Discussion started by: kevincobain2000
2 Replies
6. UNIX for Dummies Questions & Answers
I have a script that finds all sffs and extracts them into .fastq file types. What I need to do is change the .fastq to .fasta using the below script. How can I change the input.fastq and output.fasta to mirror the file's name? Would I use an array and use the default iterator?
#!/bin/bash
... (3 Replies)
Discussion started by: jrymer
3 Replies
7. Shell Programming and Scripting
Hi All,
i have the following command
df|awk '{print $5}'|grep /| egrep -v '^/$|/usr|/opt|/var/log|/home|/tmp'
output looks like:
/filesystem/number1
/filesystem/number2
/filesystem3
/possiblymoreoutput
i want the output to look like the below (either in a file or to output to... (3 Replies)
Discussion started by: Tommyk
3 Replies
8. Shell Programming and Scripting
I'd like to have the output from this script piped to a text file that has the date at the beginning of it. For example, my ideal would be something like this
$./run_script.sh
$ls *.out
2013-Feb-26-output_filename.out
Here's the code I'm using.
#! /bin/ksh
DAT=`date '+%Y-%b-%d'`
for... (2 Replies)
Discussion started by: DustinT
2 Replies
9. Shell Programming and Scripting
I'm trying to get an output to echo on the next line in a given color and outputted next to a label.
Sorry if that's a bit vague, see below.
#!/bin/bash
YELLOW=$(tput setaf 3 && tput bold)
echo -n 'plaintext' | openssl md2 || read hash
echo "$YELLOW Hash:$hash"
But I can't seem to get the... (2 Replies)
Discussion started by: 3therk1ll
2 Replies
10. Shell Programming and Scripting
Hi,
I am trying to search for a string in a file and print all the matched lines as pipe delimited format.
My command is
cat m_gid_trans.XML|grep -i '<TABLEATTRIBUTE NAME ="Lookup cache directory name"'
The output I am getting is
<TABLEATTRIBUTE NAME ="Lookup cache directory name"... (4 Replies)
Discussion started by: sampoorna
4 Replies
connld(7M) STREAMS Modules connld(7M)
NAME
connld - line discipline for unique stream connections
SYNOPSIS
#include </sys/steam.h>
int ioctl(fd,I_PUSH,"connld");
DESCRIPTION
connld is a STREAMS-based module that provides unique connections between server and client processes. It can only be pushed (see
streamio(7I)) onto one end of a STREAMS-based
pipe that may subsequently be attached to a name in the file system name space with fattach(3C). After the pipe end is attached, a new
pipe is created internally when an originating process attempts to open(2) or creat(2) the file system name. A file descriptor for one
end of the new pipe is packaged into a message identical to that for the ioctl I_SENDFD (see streamio(7I)) and is transmitted along the
stream to the server process on the other end. The originating process is blocked until the server responds.
The server responds to the I_SENDFD request by accepting the file descriptor through the I_RECVFD ioctl message. When this happens, the
file descriptor associated with the other end of the new pipe is transmitted to the originating process as the file descriptor returned
from open(2) or creat(2).
If the server does not respond to the I_SENDFD request, the stream that the connld module is pushed on becomes uni-directional because the
server will not be able to retrieve any data off the stream until the I_RECVFD request is issued. If the server process exits before
issuing the I_RECVFD request, the open(2) or the creat(2) invocation will fail and return -1 to the originating process.
When the connld module is pushed onto a pipe, it ignores messages going back and forth through the pipe.
ERRORS
On success, an open of connld returns 0. On failure, errno is set to the following values:
EINVAL A stream onto which connld is being pushed is not a pipe or the pipe does not have a write queue pointer pointing to a
stream head read queue.
EINVAL The other end of the pipe onto which connld is being pushed is linked under a multiplexor.
EPIPE connld is being pushed onto a pipe end whose other end is no longer there.
ENOMEM An internal pipe could not be created.
ENXIO An M_HANGUP message is at the stream head of the pipe onto which connld is being pushed.
EAGAIN Internal data structures could not be allocated.
ENFILE A file table entry could not be allocated.
SEE ALSO
creat(2), open(2), fattach(3C), streamio(7I)
STREAMS Programming Guide
SunOS 5.10 3 May 2004 connld(7M)