04-02-2015
This is probably the difference between line buffering on the shell, and block buffering when the result is piped. To test the theory, just pipe the find through cat in the shell. It will probably hang for quite a while too. So either your find doesn't really terminate because it searches exhaustive nfs mounted volumes or just giving it some more time might help.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
hi all,
Newbie to Unix and AIX. So my apologies if this is in the wrong place, etc.
Working on box -
uname# uname -a
AIX appt 3 5 00C08AAF4C00
when i type man (some valid command)
it just returns me to the # prompt.
Its running on the KSH shell.
man was working but i was trying... (14 Replies)
Discussion started by: djdavies
14 Replies
2. AIX
hi all,
Newbie to Unix and AIX. So my apologies if this is in the wrong place, etc.
Working on box -
uname# uname -a
AIX appt 3 5 00C08AAF4C00
when i type man (some valid command)
it just returns me to the # prompt.
Its running on the KSH shell.
man was working but i was trying... (6 Replies)
Discussion started by: djdavies
6 Replies
3. Cybersecurity
Hi,
I am trying to write a script which would figure out who has run which command and their IP. As i dont have any clue as to which commands would do this job, i request some gurus to help me on this.
Thanks
Vishwas (2 Replies)
Discussion started by: loggedout
2 Replies
4. Shell Programming and Scripting
Hi ,
I would like to assign command (with pipe) output to a variable. The code is as follows. The goal of the code is to get the last folder folder with a particular name pattern.
myDate=`ls | grep 2009 | tail -1`
echo "myDate=" $myDate
However, in the presence of the pipe, the code... (3 Replies)
Discussion started by: jeff_cen
3 Replies
5. 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
6. UNIX for Advanced & Expert Users
I would like to know why this command does not work.
I have a script which connects to and ftp site.
After getting the remote files localy i need move each remote file to a archive folder on the FTP site
*Please also note that some of the files have spaces in the file name.
Im trying to... (3 Replies)
Discussion started by: juanjanse
3 Replies
7. Shell Programming and Scripting
xargs work great when a command gives multiple line output which can be input to another. In my case it is not working coz the second command uses two words in it.
$ scr.sh
gives output like
193740
638102
375449
..
..
another command takes these number as inputs. it works great... (1 Reply)
Discussion started by: mahesh113
1 Replies
8. Shell Programming and Scripting
Hi Team,
Need a help on how to pipe a command out put to a shell script. My shell script looks like below.
cat shell_script
#!/usr/bin/ksh
input =$@
echo " we are inside the shell script"
echo " here are the input parameters"
..........................
..................
... (11 Replies)
Discussion started by: gvkumar25
11 Replies
9. Shell Programming and Scripting
Hello all!
I am trying to find the "Notes" backup from my iPhone in my folder ~/Library/Application\ Support/MobileSync/Backup/ which used to be in the sqlite file ca3bc056d4da0bbf88b5fb3be254f3b7147e639c. But since an update of the MacOS it is still there, but not updated anymore. (This is... (9 Replies)
Discussion started by: marek
9 Replies
10. Shell Programming and Scripting
Since output of w command have variable number of columns I want to get the output in pipe delimited format. I tried
export OFS="|"; w
but that does not work.
Any ideas? (4 Replies)
Discussion started by: Soham
4 Replies
popen(3S) popen(3S)
NAME
popen(), pclose() - initiate pipe I/O to/from a process
SYNOPSIS
DESCRIPTION
creates a pipe between the calling program and a command to be executed by the POSIX shell, (see sh-posix(1)).
The arguments to are pointers to null-terminated strings containing, respectively, a shell command line and an I/O mode, either for reading
or for writing.
returns a stream pointer such that one can write to the standard input of the command if the I/O mode is by writing to the file stream; and
one can read from the standard output of the command if the I/O mode is by reading from the file stream.
Because open files are shared, a type command can be used as an input filter and a type command as an output filter. If mode is other than
or the result is undefined.
A stream opened by should be closed by which waits for the associated process to terminate and returns the exit status of the command.
However, if a call caused the termination status to be unavailable to then returns -1 with errno set to This can happen in one of the fol-
lowing conditions:
o If the signal handler for is set to
o If the signal handler or another thread in the same process issues or call.
APPLICATION USAGE
After a stream is associated with a pipe by the stream is byte-oriented (see orientation(5)).
RETURN VALUE
Upon successful completion, returns a pointer to an open stream that can be used to read or write to the pipe. Otherwise, it returns a
NULL pointer if files or processes cannot be created and set errno to indicate the error. The success of the command execution can be
checked by examining the return value of
Upon successful return, returns the termination status of the command language interpreter. Otherwise, returns -1 if stream is not associ-
ated with a command and set errno to indicate the error.
ERRORS
The function fails if:
The maximum number of file descriptors allowed are currently open.
The function fails if:
The status of the child process is not available.
WARNINGS
If the original and processes concurrently read or write a common file, neither should use buffered I/O because the buffering will not work
properly. Problems with an output filter can be forestalled by careful buffer flushing, e.g., with see fclose(3S).
SEE ALSO
pipe(2), wait(2), fclose(3S), fopen(3S), system(3S), orientation(5), thread_safety(5).
STANDARDS CONFORMANCE
popen(3S)