Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [pipe]

The tag has no usage guidance.

-1
votes
1answer
20 views

Command that returns exit code still returning 0 when using “command 2>&1 | tee -a /var/log/file.log”

I'm running a script that executes a command and save the output to a file in /var/log. After that, it gets the exit code and execute another command based on an if/else condition. The problem is: 2>&...
1
vote
3answers
60 views

How to compress spaces in bash command output?

I work on a small screen and I'm trying to make the output of this command shorter, but I cannot get it to work. Command: docker container ls --all Output (too wide!): CONTAINER ID IMAGE ...
0
votes
1answer
70 views

Backuppc | Got fatal error during xfer (aborted by signal=PIPE)

I am running backuppc version 3.3.1 on an Ubuntu 16.04.5 LTS, I try to backup several Linux servers, almost Debian, ubuntu or proxmox hosts. My issue is that when I run the Full/Incermental backup ...
0
votes
1answer
85 views

Are bash pipes lazy or eager?

I was watching this command run tar cf - 20180412 -P | pv -s $(du -sb 20180412 | awk '{print $1}') | gzip > 20180412.tar.gz 9.02GiB 0:01:20 [ 114MiB/s] [============================================...
0
votes
1answer
98 views

set up master slave over ssh and port pipe for a Mysql replication

Everything started when I was asked to set up a syncing method for our Mysql server. Considering that I am a developer I got into deep waters first with DBA and now I found myself into SysAdmin. So I ...
1
vote
0answers
62 views

dovecot/postfix/postgres and piping mail to script

I'm trying to pipe mail to script I added lines like these to /etc/postfix/master.cf: myscript unix - n n - - pipe flags=F user=root argv=/var/myscript/igotmail.sh ${sender} ${size} ${recipient} ...
2
votes
0answers
110 views

stream a command's stdout, and merge with terminal's stdin to a single stdout

This answer shows numerous ways to stream multiple commands into another command, but since they use subshells you can't do stdin. While you can achieve this with named pipes, it's somewhat ugly and ...
0
votes
0answers
46 views

| date +'%b %d %T %Y' will return a current date

I'm trying to re-format a date: $ openssl x509 -enddate -noout -in cert.pem notAfter=Jan 30 02:19:17 2018 GMT But: $ openssl x509 -enddate -noout -in cert.pem | date +'%b %d %T %Y' Dec 26 11:25:...
1
vote
1answer
768 views

How to send text to stdin of docker container?

I have a docker container which runs a java program in foreground on startup. The java program listens to input on stdin. How can I programmatically send text to the java program? The container is ...
-1
votes
1answer
174 views

dovecot thinks alias to pipe is a user, rejects email

I have an AWS EC2 instance running Amazon Linux with Postfix for serving mail. I have only local users -- no virtual users -- and my users and aliases are served via PostgreSQL. My aliases table in ...
0
votes
2answers
418 views

Large mysql dump pipe to s3

Is there any problem in doing this with lots of data? mysqldump ... | gzip | s3cmd put - s3://bucket/file.sql.gz The MySQL dump is about 100GB in size. What happens if gzip or s3cmd can't process ...
1
vote
0answers
137 views

Read named pipe as output to echoing to a pipe

I've created a few named pipes for a few client programs such as cec so I only need to make the connection once in the background and just pipe in commands. Most of the time I don't need to read the ...
3
votes
3answers
481 views

Grep regex Stdout to telnet

I'm trying to use grep to get a regex result and pipe the results on-the-fly to telnet running an open port to a node server. The grep received continuous, but varied in interval, commands from a ...
0
votes
1answer
69 views

Can I filter output from `tail` with the `-f` flag?

I'd like to tail -f the output of access_log on RHEL 6.8 but pipe and grep that output to act as a filter. Is there such an option? That is I'd like live output from: # tail -f error_log | grep <...
0
votes
1answer
496 views

gzip piped output into ssh command

I make backup over ssh like this: mysqldump -u dbuser -pXXXXXXXX dbname | ssh -i ~/.ssh/id_rsa_backup backup@my.server.com 'cat > /var/backups/services/my_service/db/$(date +"%Y-%m-%d").sql' How ...
2
votes
1answer
712 views

Starting and stopping piped processes with Supervisor

I have a situation where I pipe the output of ffmpeg into a PHP script for some processing. I might have a few of these processes running at any given time and I figured to start and stop them I might ...
7
votes
2answers
866 views

Cat, Grep, Redirect Output… Blank File?

I just ran cat /opt/webapplications/Word/readme.log | grep -v 'Apple' and I got the output on the cli that I was expecting, which was all the lines in readme.log that did not contain 'Apple'... ...
1
vote
1answer
73 views

How do I pipe stdout and std error to a file and back to stdout on Windows?

On Windows when running a batch script I want to record the output of I run: myprogram.bat 1> mylog.log 2>&1 Which is great - but I have to run a separate tail process to read the output ...
0
votes
2answers
380 views

Streaming stdout

I have a script that outputs a lot of debug data that I would like to avoid to save on disk (specially since the file system is on a flash memory card). So I run it on the background with nohup + &...
3
votes
1answer
6k views

How to avoid “in use by another process” errors when piping output through a program?

In a Windows environment, are executable programs that are used to process piped output guaranteed to be unique tasks if called from different CMD environments? For example, suppose script1.cmd ...
1
vote
1answer
305 views

How to pipe a file being written to?

I have a binary file that is being written to continuously. I need to read the full content of that file to a pipe (either to nc or to a FIFO) and keep reading it while its is written (i.e. the ...
2
votes
3answers
5k views

Unzip from stdin to stdout - funzip, python

The goal is to read a zip file from stdin and uncompress to stdout. Funzip works and is the solution I am looking for, the zip contains a single file, unfortunately funzip fails when the compressed ...
-1
votes
1answer
281 views

Cron: Execute python script, capture stdout & stderr and send via msmtp [duplicate]

I try this for almost 4 hours now, in different ways. I googled a lot, but nothing I try work as expected. I have a simple .msmtprpc file, that allows me to send mails like this: echo -e "Subject: ...
0
votes
1answer
2k views

wget and pipe to tar in the background

I am trying to download a large file which is .tar.gz and (> 2GB) in size. The bash script also does lots of other things, so I want to kick off the download and then continue processing other ...
6
votes
2answers
4k views

Apache errorlog piping fail

Trying to log to a central syslog server, either direct using Apache's ErrorLog to pipe to logger, or getting syslog to forward, but nothing is working and the errors are not making sense to me. I can ...
1
vote
2answers
775 views

How to pipe postfix into Codeigniter controller

I currently have postfix piping into a PHP script to process the email via an alias. catchall: |/var/www/vhosts/website/httpdocs/scripts/incoming_mail.php However, I wish to use the DB config etc ...
0
votes
0answers
256 views

Remote packet capturing using fifo and dumpcap

I'm currently working on two linux servers where one server is running in 2.6.18-274.el5(Server A) and the second one in CentOS 7 (Server B). My requirement is to capture the packets of the network ...
6
votes
3answers
1k views

Postfix - Pipe multiple recipient message as a single message

I am trying to pipe emails through Postfix to a Python script I have. Currently, messages with multiple recipients are piped to the script once for each recipient. I would like these messages to be ...
1
vote
1answer
231 views

Postfix pipe mail at user level

I am trying to filter mail at the user level. I have CentOS and Postfix installed. I managed to install a filter on the server and its working great, except, instead of filtering by user, all emails (...
1
vote
1answer
529 views

Pipe multiple files into one tar gz

I'd like to call mysqldump to create multiple backup files and then archive them in one tar.gz. I am following this tutorial on mysqldump part: http://dev.mensfeld.pl/2013/04/backup-mysql-dump-all-...
0
votes
2answers
149 views

Unzip piping order

I have a file, foo.zip which looks something like this: foo.zip -- fileA.txt -- fileB.txt I can pipe the output of the extracted files like this: unzip -p foo.zip *.txt | something My problem is ...
3
votes
1answer
336 views

does email pipe to program cause problems with unicode characters?

I'm piping incoming mail into a PHP script, immediately storing the RAW email in a MySQL db. It works very well, except ~0.7% of emails arrive with a truncated message body. I found someone whose ...
1
vote
1answer
53 views

pipe rrd to a new directory

I am chrooted and running out of drive space, so I mounted back to the host drive which has plenty of space but cannot seem to redirect the outputted data to my empty drive [root@localhost rra]# ls /...
2
votes
3answers
13k views

Can't pipe echo to netcat?

I have the following command: echo 'HTTP/1.1 200 OK\r\n' | nc -l -p 8000 -c and when I curl localhost:8000 I am not seeing HTTP/1.1 200 .. being printed. I am on mac os x with netcat 0.7.1 Any ...
1
vote
1answer
553 views

Exim4 setup not working with piping

I'm trying to setup exim4 on the server, so that it can receive mail for a couple sub domains, and I want to pipe that to a PHP script. I want all incoming mail to be processed through my custom ...
5
votes
4answers
6k views

how to pipe a mysql dump to s3cmd

I want to transfer a mysql dump, compressed, to s3. I tried: mysqldump -u root -ppassword -all-databases | gzip -9 | s3cmd put s3://bucket/sql/databases.sql.gz but then I get: ERROR: Not enough ...
1
vote
1answer
289 views

Cat pipe mysql : Stopped. What stopped and how can I fix that?

I imported a large database from remote using a cat + mysql command : cat my_db.sql | mysql --host=external_host --user=my_user --password=some_password my_database And after some time, it returned ...
1
vote
5answers
611 views

How to split the output into different files?

I have a input file like foo xxx yyy zzz foo xxx yyy zzz foo xxx yyy zzz foo xxx yyy zzz bar xxx yyy zzz bar xxx yyy zzz foo xxx yyy zzz .. How to split the input file by line, into foo.txt ...
1
vote
1answer
415 views

Postfix Pipe then forward to original recipient

I may well be on the wrong track here with what I'm trying to do, so I'd appreciate any advice. Is it possible to pipe email to a script (which I have working), and then have Postfix forward it on ...
0
votes
2answers
727 views

Powershell pipe exporting to csv is loosing data

I'm trying to write a script that will take input from a .txt file of IP address. Do a reverse DNS lookup to get the hostname of the IP address and then export that data into .csv file. Here is what ...
2
votes
2answers
1k views

SELinux preventing /etc/aliases email pipe to script from working

When somebody sends an email to my server, e.g. somestringthatisnotnecessarilyauser@myserver.com I want it to pipe to a PHP script. So in my /etc/aliases file I have: ...
0
votes
1answer
140 views

How to comma-demilit the output from cut?

So far, I have this: grep -B 36 'pattern1' Mapper.1.Configuration.MapRules | grep "pattern2" | cut -d'"' -f2 which give me a new-line delimited list of values that I need. I could put this into a ...
1
vote
2answers
515 views

how to pipe results from LS to CD in ubuntu

I'd like to ls for the latest created directory in a given directory (we create a new folder for each release) and then cd to that directory. I'd like to create an alias for this so I don't have to ...
-1
votes
1answer
426 views

Make a copy of email using pipe in postfix alongside 1 content_filter

I am using postfix and already usHi. I am using postfix and already using a script as a content_filter which re-injects back to smtpd to all users, but before this happens, I would like to make a copy ...
0
votes
2answers
1k views

pipe raw email message to python script

In exim4, I use following pipe to send a message to a python script, process it, and upload it to django: send_to_django_mailbox: driver = pipe command = /usr/local/bin/python /etc/exim4/conf.d/...
8
votes
5answers
623 views

Grep-ing gzipped files [duplicate]

I have a set of 100 log files, compressed using gzip. I need to find all lines matching a given expression. I'd use grep, but of course, that's a bit of a nightmare because I'll have to unzip all ...
1
vote
1answer
6k views

Postfix: Pass a copy of an email to a script but deliver the original one to mailbox

It's actually quite simple: I want to pass all incoming emails to a PHP-script, but only as a copy, the original email shall still be delivered to the mailbox as usual. I just can't seem to get it ...
0
votes
2answers
774 views

Procmail - Replace From with text from within email

I am trying to use Procmail to filter through mail that goes to my ticket channel in WHMCS. It works fine as far as piping goes. But emails from the Zopim live chat module on the site need filtering ...
0
votes
1answer
271 views

Tell Postfix to pipe From certain emails to certain scripts

I am currently using Postfix to pipe incoming email form our support email address to our WHMCS install to the support department. This has been working great for sometime. Problem is now we have a ...
2
votes
1answer
90 views

Postfix - Transferring NOTIFY command to script using pipe

I have set up system where all mails are piped to my script. In master.cf I have: phptran unix - n n - - pipe flags=DFORq user=nobody argv=/usr/bin/php5 /root/phptran.php ${sender} ${recipient} I ...