Questions tagged [pipe]
The pipe tag has no usage guidance.
156
questions
-1
votes
2
answers
71
views
mailx Set Name of Attached File
I have a cron job, whose output I send to mailx:
# Monday morning at midnight; "mail" is symlink to "mailx"
00 00 * * mon python3 script-with-7500line-output.py | mailx -S 'from=...
1
vote
1
answer
179
views
How to make PowerShell read from a pipe?
I need to make PowerShell on Windows Server 2019 to read from a (not named) pipe and launch the commands it reads, so I'll be able to launch multiple commands on the same shell, even without knowing ...
0
votes
0
answers
279
views
After piping Incoming mails to external script, mails are not shown in Inbox in iRedmail
I have been trying to pipe incoming mails to my python script which is just trying to read a mail and look for keywords and call api. But for some reasons my mails are not being delivered to my inbox. ...
0
votes
1
answer
960
views
Pipe into command stored in bash variable
I enter two command in bash:
$export g='grep "something"'
$echo "something and another thing" | $g
But it doesn't work.
I want the second command to be evaluated by bash as : ...
0
votes
1
answer
426
views
Why tail to same file create a empty file, or empty the file? [duplicate]
I try to maintain the last lines of a file, but when tail -n 10 test.txt > test.txt create or empty the file...
SO: Ubuntu server
Example:
#test.txt file 20 May 23 12:24 test.txt
a
a
a
a
a
a
...
0
votes
2
answers
299
views
how to extract a certain field from standard output with cut?
I have this output and want to extract the IMAGE ID from it
$ podman image ls | grep youtube-dl
localhost/youtube-dl latest 2d4e37c4d609 3 hours ago 205 MB
All I know piping ...
1
vote
2
answers
335
views
cmd pipe -> System cannot find specified path
Using cmd on Windows 10 Pro 21H2, when I try
echo Hello | find "Bye"
I get The system cannot find the specified path. Same thing if trying
echo Hello | C:\Windows\System32\find.exe "...
2
votes
2
answers
2k
views
Is it possible to pipe qemu-img into SSH target?
I tried the following command, but only an empty file is created on the target and the command stays open
qemu-img convert -f raw -O vmdk /dev/sda1 - | ssh foo@bar "cat > /home/foo/foobar.vmdk&...
0
votes
2
answers
462
views
Piping nc to sed and evaluate datetime for each row
Could someone provide any idea, how could i pipe data from nc to sed (or awk, or anything) and evaluate and write to file a timestamp after each row?
What i have:
# cat /etc/systemd/system/ncserver....
0
votes
1
answer
514
views
How can wireshark.exe on windows read from a pcap file stream?
This is probably less a wireshark question and more a "how do I pipe a file into an application" on windows.
On linux, I can capture a pcap file on another host with tcpdump and pipe it back ...
0
votes
1
answer
291
views
Linux shell: Pipe stderr and stdout to one file AND to individual files at the same time (using tee?)
I would like to form a pipe-stream that captures stdout to one file and stderr to another file AND both in a third file (so also the complete terminal output is in one file)
somehow like this:
process ...
0
votes
1
answer
356
views
Linux does STDOUT | STDIN piping write data to disk?
I was planning on passing encryption keys to zfs load-key pool/set through stdin. The keys passed are generated by another program in HEX format and dataset is configured to have keylocation=prompt, ...
0
votes
2
answers
286
views
nethogs -t | awk '{print $0}' return no output
nethogs is a linux process bandwidth monitoring tool. https://github.com/raboof/nethogs
nethogs -t
it's output looks like this.
Refreshing:
sshd: root@pts/0/4002/0 0.185156 0.0773437
unknown ...
0
votes
2
answers
4k
views
Run a multiline bash script piped from stdin
I'm looking for a simple way to include multi-line scripts inline in documentation to make it transparent what each step does.
This works
echo "echo 1234" | bash
So does this
echo 'for N in 1 2 3; ...
0
votes
0
answers
53
views
Is there any way to "stop following" in less without pressing Ctrl+C?
If I pipe the output of a long-running command to less, for example:
foreman start | less -SR
And I now press F to follow the output of foreman, is there any way to tell less to stop following, ...
12
votes
3
answers
12k
views
tee and assigning to variable?
I need to see output on the screen and at the same time grep the output and send grep result to variable. I think it can be done with tee but I can't figure out how exactly. I tried
mycommand | tee ...
0
votes
2
answers
288
views
re-parenting to screen two processes joined by pipe [duplicate]
Let's say in a PuTTY connection I start
mysqldump --host host1 --databases db1 db2 db3 | mysql
which creates two processes: mysqldump with PID 5800 and mysql with PID 5801. Is it possible to let the ...
1
vote
1
answer
1k
views
Mysqldump to compressed file
Situation:
1. mysql is backuped to disk with mysqldump (~250 GB)
2. dump is compressed with bpzip2
3. dump is moved to another DC
4. disk usage again in good state
Problem:
Filesystem usage peaks, ...
1
vote
2
answers
1k
views
Send email if script outputs string
I found this line:
sh script.sh | grep 'NO' 2>&1 > grep.log && /usr/bin/mail -s "grep found something" m@mail.com < grep.log
which will write the output of script.sh to grep.log ...
0
votes
1
answer
2k
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
3
answers
138
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
1
answer
2k
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
1
answer
321
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
1
answer
643
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
0
answers
186
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
0
answers
556
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 ...
7
votes
2
answers
9k
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
1
answer
388
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
2
answers
1k
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
0
answers
320
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
3
answers
1k
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 ...
1
vote
1
answer
257
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 <...
1
vote
1
answer
2k
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
1
answer
2k
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 ...
9
votes
2
answers
3k
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
1
answer
304
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
2
answers
649
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
1
answer
12k
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
1
answer
707
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 ...
18
votes
5
answers
32k
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
1
answer
725
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: ...
1
vote
1
answer
5k
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
2
answers
8k
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
2
answers
1k
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
0
answers
354
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 ...
5
votes
3
answers
3k
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
1
answer
575
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
1
answer
1k
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
2
answers
317
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
1
answer
560
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 ...