The tag has no wiki summary.

learn more… | top users | synonyms

0
votes
1answer
190 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: support@myhost.com redmine master.cf: redmine ...
0
votes
2answers
2k 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: ...
1
vote
3answers
326 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 ...
3
votes
2answers
143 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 ...
4
votes
5answers
656 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 ...
5
votes
2answers
3k 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 ...
3
votes
2answers
304 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 ...
2
votes
1answer
820 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, ...
0
votes
1answer
984 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; ...
6
votes
1answer
708 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 ...
5
votes
2answers
3k 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 ...
3
votes
0answers
698 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 ...
0
votes
3answers
480 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 ...
0
votes
2answers
80 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: ...
0
votes
2answers
378 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 ...
1
vote
1answer
106 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: ...
0
votes
3answers
1k views

forward all mail on a specified domain to script

Hey all! 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 ...
11
votes
3answers
861 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 ...
5
votes
3answers
3k 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 utilised this quiet a bit where i ...
0
votes
1answer
765 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 ...
2
votes
2answers
562 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 ...
0
votes
3answers
818 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 ...
3
votes
1answer
710 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 . ...
1
vote
4answers
931 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 ...
0
votes
1answer
129 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. $ ...
1
vote
1answer
644 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)?
0
votes
1answer
1k 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 ...
1
vote
1answer
360 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 ...
1
vote
1answer
315 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 ...
2
votes
2answers
445 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 support@domain.com to our ticket system on our server with our email being hosted via Google Apps. Is it possible to pipe a ...
1
vote
3answers
3k 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 ...
1
vote
2answers
300 views

Top like viewer eating tail -f stream

Hi there 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 ...
0
votes
1answer
180 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 ...
0
votes
1answer
208 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 ...
4
votes
4answers
143 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? ...
1
vote
8answers
9k 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 ...
1
vote
1answer
286 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 ...
4
votes
1answer
464 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: ...
2
votes
2answers
252 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" > ...
1
vote
2answers
3k 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 ...
0
votes
3answers
2k 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 ...
0
votes
3answers
1k 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 ...
1
vote
1answer
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 username@gmail.com Do you know how I can configure my exim4 server on Debian to do so ? (My exim configuration seams to be split in different ...
1
vote
2answers
1k 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 ...
1
vote
7answers
2k 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 ...
15
votes
4answers
14k 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 ...
2
votes
2answers
2k views

Why is my apache log missing information?

I have a SSL-enabled Apache server which utilizes rotate log to archive the log files. The problem is that when the logs are "rotated", some information get lost... For example, all authenticated ...
0
votes
5answers
2k 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/' ...
0
votes
6answers
1k 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, ...
14
votes
3answers
8k 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 ...