Sponsored Content
Operating Systems Linux SuSE Find command doesn't pipe the output as required. Post 302940249 by Walter Misar on Thursday 2nd of April 2015 10:38:55 AM
Old 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

Man command doesn't display any output amonst other problems :-)

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

Man command doesn't display any output amonst other problems

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

Help Required: Command to find IP address and command executed of a user

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

Assign command (with pipe) output to a variable

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

is there any way of using rm command on output of pipe

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

Pipe text in to find command

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

Pipe output a command to another using xargs

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

How to pipe command output to shell script?

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

Find or ls with pipe to the command file

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

Get the output of w command in pipe delimited format

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
IPC::Open2(3pm) 					 Perl Programmers Reference Guide					   IPC::Open2(3pm)

NAME
IPC::Open2 - open a process for both reading and writing using open2() SYNOPSIS
use IPC::Open2; $pid = open2(*CHLD_OUT, *CHLD_IN, 'some cmd and args'); # or without using the shell $pid = open2(*CHLD_OUT, *CHLD_IN, 'some', 'cmd', 'and', 'args'); # or with handle autovivification my($chld_out, $chld_in); $pid = open2($chld_out, $chld_in, 'some cmd and args'); # or without using the shell $pid = open2($chld_out, $chld_in, 'some', 'cmd', 'and', 'args'); waitpid( $pid, 0 ); my $child_exit_status = $? >> 8; DESCRIPTION
The open2() function runs the given $cmd and connects $chld_out for reading and $chld_in for writing. It's what you think should work when you try $pid = open(HANDLE, "|cmd args|"); The write filehandle will have autoflush turned on. If $chld_out is a string (that is, a bareword filehandle rather than a glob or a reference) and it begins with ">&", then the child will send output directly to that file handle. If $chld_in is a string that begins with "<&", then $chld_in will be closed in the parent, and the child will read from it directly. In both cases, there will be a dup(2) instead of a pipe(2) made. If either reader or writer is the null string, this will be replaced by an autogenerated filehandle. If so, you must pass a valid lvalue in the parameter slot so it can be overwritten in the caller, or an exception will be raised. open2() returns the process ID of the child process. It doesn't return on failure: it just raises an exception matching "/^open2:/". However, "exec" failures in the child are not detected. You'll have to trap SIGPIPE yourself. open2() does not wait for and reap the child process after it exits. Except for short programs where it's acceptable to let the operating system take care of this, you need to do this yourself. This is normally as simple as calling "waitpid $pid, 0" when you're done with the process. Failing to do this can result in an accumulation of defunct or "zombie" processes. See "waitpid" in perlfunc for more information. This whole affair is quite dangerous, as you may block forever. It assumes it's going to talk to something like bc, both writing to it and reading from it. This is presumably safe because you "know" that commands like bc will read a line at a time and output a line at a time. Programs like sort that read their entire input stream first, however, are quite apt to cause deadlock. The big problem with this approach is that if you don't have control over source code being run in the child process, you can't control what it does with pipe buffering. Thus you can't just open a pipe to "cat -v" and continually read and write a line from it. The IO::Pty and Expect modules from CPAN can help with this, as they provide a real tty (well, a pseudo-tty, actually), which gets you back to line buffering in the invoked command again. WARNING
The order of arguments differs from that of open3(). SEE ALSO
See IPC::Open3 for an alternative that handles STDERR as well. This function is really just a wrapper around open3(). perl v5.18.2 2013-11-04 IPC::Open2(3pm)
All times are GMT -4. The time now is 10:01 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy