Questions tagged [pipe]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
343 views

Forward mail to mailbox in addition to piping

I've set up postfix to pipe emails through rdm-mailhandler.rb (redmine), but I'd also like the emails to be delivered to the mailbox. transport: [email protected] redmine master.cf: redmine ...
simendsjo's user avatar
  • 354
5 votes
2 answers
10k views

Piping in postfix/aliases [duplicate]

Possible Duplicate: How to configure postfix to pipe all incoming email to a script? I'm having problems setting up simple piping for Redmine (or '|cat > /tmp/temp') /etc/postfix/virtual: ...
simendsjo's user avatar
  • 354
1 vote
3 answers
819 views

How to get the output of a php script executed by a piped mail?

I've configured an email address to pipe (forward) all emails to /path/to/script.php I thought I'll receive the output of the script as an email reply but it doesn't work. How can I get the output ...
User's user avatar
  • 277
3 votes
2 answers
193 views

Programme that accepts stdin, then writes to a datetime stamped file?

I wonder is there a programme that'll do what I want. This is like an streaming log rotation programme. For the linux/unix command line. Let's say I have some input that is streaming some data. I ...
Amandasaurus's user avatar
  • 32.3k
6 votes
5 answers
11k views

Bash: Execute piped lines from stdin

I haven't found a solution to this after some searching. I think the search terms are just too general. I'd like to know how to execute a number of lines (at the bash prompt) which are generated by ...
SabreWolfy's user avatar
14 votes
1 answer
31k views

How do I pipe the output of uptime/df to curl?

I want to send the output of uptime and df commands to a web app using cURL. I tried: uptime | curl http://someurl.com -T - But that didn't seem to send the data. What is the proper way to send ...
Callmeed's user avatar
  • 2,715
3 votes
2 answers
2k views

Linux Pipe, Warning Messages, stdout

This is probably the best place to ask the question in its simplest form. I am writing a script which takes output of a command and puts it into a variable. After some debugging I figured out the ...
jinanwow's user avatar
  • 453
2 votes
1 answer
2k views

pipe multiple files, single ssh connection, remote commands

I'd like to pipe several files to a remote server, piped as input to commands run on the remote server, over ssh, but only one ssh connection/command is permitted. (In the remote authorized_keys file, ...
grojo's user avatar
  • 429
1 vote
1 answer
2k views

Why is this apache php piped log script not working properly?

i have a piped logging program like this: #!/usr/bin/php <?php $fd = fopen("php://stdin", "r"); while(true) { $l = fread($fd,8192); $l = trim($l); if($l =="") continue; file_put_contents('...
The Shurrican's user avatar
8 votes
1 answer
3k views

using temporary files vs pipes advantages and disadvantages

Say I have a file named jobs.csv and I would like to get the top 50k jobs done by Foo I can either do: # cat jobs.csv | sort -u | head -n 50000 > /tmp/jobs.csv # cat /tmp/jobs.csv | while read ...
Tzury Bar Yochay's user avatar
33 votes
3 answers
26k views

How can I handle spaces in file names when using xargs on find results?

One of my common practices is to perform greps on all files of a certain type, e.g., find all the HTML files that have the word "rumpus" in them. To do it, I use find /path/to -name "*.html" | xargs ...
abeger's user avatar
  • 481
4 votes
0 answers
1k views

DSGET escapes hash signs (#) in outputted Distinguished Names (DN)s but expects unescaped hash signs for input

Lets say I want to do the very simple query in AD dsquery user -name "John Smith" | dsget user -memberof -expand This will output the DNs of the AD groups that this user belongs to. I can make it ...
Justin Dearing's user avatar
0 votes
3 answers
1k views

how to "batch" output of "tail -F" or output all data in a stream every X seconds?

I am trying to monitor a log file in real-time. Say I issue a command such as: tail -F mysystem.log|grep -i error|mail ... This is supposed to monitor my log file, every time it sees an error, email ...
user23398's user avatar
  • 1,231
0 votes
2 answers
156 views

Piping emails from a development server to a text file

Is there a way to capture all mail from a unix server and pipe it to a log file? Or maybe at least all mail from PHP? I know of a trick where in php.ini sendmail is tricked byt this line: ...
naxoc's user avatar
  • 101
0 votes
2 answers
863 views

How pipe email to PHP with Maildirs

I used to pipe incoming emails using: |/path/to/php/script in .forward file at /home folder. But the actual system I'm working on is based on Maìldir instead MBOX. So that solution does not work. I ...
user avatar
1 vote
1 answer
135 views

receiving two emails to virtual alias

have a virtual alias setup in /etc/postfix/virtual that reads: @mydomain.com mydomainincoming I then have a pipe setup in /etc/aliases that reads: mydomainincoming: "|/var/path_to_script/myscript....
Richard Castle's user avatar
0 votes
3 answers
3k views

forward all mail on a specified domain to script

I run a disposable e-mail service that accepts all incoming mail and forwards it to a PHP script that stores it in a database for people to view. Before now, I have been on shared hosting with cPanel, ...
Ashley Strout's user avatar
13 votes
3 answers
2k views

On Linux, how can I see how far through a file a process is?

If I have a piped command such as cat myfile | processor_application where processor_application is something reading from standard in, in chunks, to process, is it possible to see how far ...
wodow's user avatar
  • 590
14 votes
3 answers
15k views

Redirect output of mysqldump to scp

I worked with a Linux pro years ago who did this nifty trick. He could do a mysqldump but redirect the output to an scp/ssh connection rather than writing to disk. We used this quite a bit where I ...
xzyfer's user avatar
  • 323
1 vote
1 answer
1k views

How do I copy stdout and stderr into a log file in Windows XP?

I have a script that I'm running from a command line. I want the stdout and stderr to be displayed on the screen and also to be copied into a logfile with append. What is the syntax for this piping/...
Erick Robertson's user avatar
2 votes
2 answers
893 views

Bash Parallelization of CPU-intensive processes

tee forwards its stdin to every single file specified, while pee does the same, but for pipes. These programs send every single line of their stdin to each and every file/pipe specified. However, I ...
ehsanul's user avatar
  • 427
0 votes
3 answers
5k views

Hang and broken pipe when rebooting over ssh

I'm trying to reboot one box from another, using the following command: ssh 10.0.0.26 'reboot --force' I expect this to block for a short while until the other box reboots, then return. What I see ...
me_and's user avatar
  • 158
63 votes
1 answer
67k views

Capturing STDERR and STDOUT to file using tee

I'm unclear what the best order is to capture both STDERR and STDOUT to the same file using tee. I know that if I want to pipe to a file I have to map the filehandle after the redirect, i.e. find . &...
PP.'s user avatar
  • 3,426
2 votes
4 answers
1k views

Is there an easy way to insert data/time in front of a log file with just shell scripting?

Say I want to monitor memory usage on a java process overnight. I can do something like top | grep java > out.log I will get a log file with a whole bunch of lines. Is there an easy way to get a ...
James Dean's user avatar
0 votes
1 answer
182 views

How to display results without two first lines

When I run some bash command it returns 2 .. n lines of text (n is different each time, may contain blank lines). How to filter the output to display the result skipping lines 1 and 2? e.g. $ ...
takeshin's user avatar
  • 1,481
2 votes
2 answers
4k views

Non-blocking bash redirection

Does anyone know how to redirect the output of a program, running from a bash script, to a named pipe IN NON BLOCKING MODE (having 'O_NONBLOCK' flag set)?
anderson's user avatar
  • 301
0 votes
1 answer
3k views

Is there any limit to AIX 5.3 pipe size?

I'm in trouble while performing cat/tail/head operation on large files on Aix 5.3. When asking for a cat of several 1Go file redirected to another one: cat file1 file2 file3 > outputfile The ...
snowflake's user avatar
  • 127
1 vote
1 answer
3k views

sed can't find a file that obviously exists

I run the following command which comments out all lines that contain the text "dlclose" grep -lIR "dlclose" . | grep -v ".svn" | xargs sed -i "s/.*dlclose.*/\/\/&/g" However, sed claims that ...
user50914's user avatar
  • 121
1 vote
1 answer
1k views

Comment all lines matching some pattern

I need to comment out all lines containing "dlclose" for each file in the current directory and any sub-directories (recursively). This is my best guess so far given what I was able to find out from ...
user50914's user avatar
  • 121
2 votes
2 answers
2k views

Pipe email from google apps to server php script

I'm wondering if anyone here would have any ideas on how I can pipe [email protected] to our ticket system on our server with our email being hosted via Google Apps. Is it possible to pipe a ...
Ben's user avatar
  • 3,880
1 vote
3 answers
5k views

Scripting (piping) commands into a telnet session

i use a cronjob to execute a filetransfer to a host and then telnet into the host and pipe some commands into it. HOST=somehost USER=postgres PASSWD=blabla ftp -n -v $HOST <<END_SCRIPT quote ...
javadude's user avatar
  • 239
1 vote
2 answers
409 views

Top like viewer eating tail -f stream

I'm searching for a command line tool working with a stream of lines (tail -f typically) and counting them like : tail -f /var/log/apache2/access.log | cut -d' ' -f1 | SOME_COMMAND and displaying a ...
Mandark's user avatar
  • 251
0 votes
2 answers
1k views

how to check open ports of bunch of website at once with nmap/linux?

I want to use nmap in such a way that I could check bunch of server's port at once for checking whether their particular port is open or not? right now I have 10 ip addresses but in future this could ...
Vahid Hashemi's user avatar
0 votes
1 answer
337 views

Does Apache spawn piped logger on each HTTP request?

I am examining a high-volume Apache prefork site and noticing that many log entries such as: CustomLog '|/foo/bar/cronolog -foo -bar' RewriteLog '|/foo/bar/cronolog -bar -foo' When apache logs the ...
Jé Queue's user avatar
  • 363
4 votes
4 answers
177 views

Is there a *Nix tool that can be used to format command output that is too wide for the screen?

I'm running psql -U postgres template1 -c "select * from pg_stat_activity" and the output is too wide for my terminal. Is there a *nix command I can use to prevent the output from wrapping? ...
erikcw's user avatar
  • 697
3 votes
8 answers
34k views

PsExec and Remote Environment Variables, Logging, Etc

When I run PsExec on a remote computer, I always fall short of what I want. What I would like ideally in most situations is a) a log on an admin server where each individual log has the name of each ...
user avatar
1 vote
1 answer
578 views

Exim 4 pipe select command/script from mysql db

Is there an option to run a mysql lookup in the pipe driver of exim? MYSQL_Q_SCRIPT=SELECT script FROM MYSQL_EMAILTABLE WHERE domain='${quote_mysql:$domain}' AND local_part='${quote_mysql:$local_part}...
user28047's user avatar
  • 125
4 votes
1 answer
937 views

Delete a directory with pipe (|) in its name?

Without booting to Linux, how do you delete a directory that was created in Linux on an NTFS partition that contains a pipe in the file name? For example: f:\flac\foreign\Yoshida_Brothers\...
Dave Jarvis's user avatar
3 votes
2 answers
684 views

Pipe program output into a protected file using sudo

I want to do the following: $ echo "secrets" > protected_file But the the problem is, I don't have file permissions for "protected_file", so I try the following: $ sudo echo "secrets" > ...
geofflee's user avatar
  • 196
5 votes
2 answers
6k views

Updating a file in a zip archive from STDIN

I want to update/freshen a file in a zip archive with the contents of stdin. So far I haven't been able to find a way to tell the zip command that the contents of stdin correspond to a particular file....
Bo Jeanes's user avatar
  • 1,530
22 votes
4 answers
20k views

Count number of bytes piped from one process to another

I'm running a shell script that pipes data from one process to another process_a | process_b Does anyone know a way to find out how many bytes were passed between the two programs? The only solution ...
Simon Hodgson's user avatar
1 vote
3 answers
2k views

Bash piping answer in Ubuntu

In a bash script, I want to know know how to pipe in answers like for example: ssh -l username -i /home/ubuntu/.ssh/id host.com < yes The ssh connection would ask if I would like to continue the ...
user avatar
1 vote
1 answer
2k views

How to ask exim4 to redirect some email pattern to a specific email address?

I would like to redirect all email from *@domain.fr to [email protected] Do you know how I can configure my exim4 server on Debian to do so ? (My exim configuration seams to be split in different ...
Natim's user avatar
  • 636
1 vote
2 answers
3k views

FreeBSD Traffic Shaping

I'm trying to do traffic shaping with FreeBSD, here are my rules su-3.2# ipfw show | grep pipe 08380 1514852 125523804 pipe 1 tcp from any to any dst-port 80 su-3.2# ipfw pipe 1 show 00001: 2.000 ...
alexus's user avatar
  • 13.4k
2 votes
7 answers
3k views

Running script in background without sticking to shell

i want to run a shell script remotely via ssh and the ssh shell should end when the script ends. The script itself runs another script whose output is piped to a log file. Example: I run the script ...
user avatar
29 votes
4 answers
26k views

How to pipe stderr without piping stdout

How do I pipe the standard error stream without piping the standard out stream? I know this command works, but it also writes the standard out. Command 2>&1 | tee -a $LOG How do I get just ...
C. Ross's user avatar
  • 3,105
0 votes
6 answers
3k views

How to recursively search and replace from command line on unix/linux system

So I want to change several files at one with one command. This is what I have so far: find -regex ".*\.ext$" | xargs grep -l searchText 2> /dev/null | xargs -i sed 's/searchText/replaceText/' >...
Keith Bentrup's user avatar
0 votes
6 answers
2k views

How to run command on parts of input file

I have ~ 40GB file, and a filter command that for some reason breaks when I try to run it on the file (even when passed via pipe). But. It doesn't fail when I split input file into many small files, ...
user avatar
69 votes
4 answers
60k views

How can I get more info on open pipes show in /proc in Linux?

In Linux if you go digging in /proc/<pid>/fd often you'll see output like: lrwx------ 1 root root 64 Jul 30 15:14 0 -> /dev/null lrwx------ 1 root root 64 Jul 30 15:14 1 -> /dev/null l-wx-...
Kamil Kisiel's user avatar
  • 12.3k
4 votes
5 answers
3k views

Looping a command over a list of arguments in Linux

How to execute the same command with arguments that are delivered by another command via pipe? As a result of the extraction of file names from a source I get: $some_command filename1 ...
Alex's user avatar
  • 2,407