Questions tagged [pipe]

156 questions
4
votes
5 answers

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 filename2 filename3 ... filenameN I'd…
Alex
  • 2,287
  • 5
  • 32
  • 41
4
votes
0 answers

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 print the friendly group name via: dsquery user…
4
votes
4 answers

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? Maybe a setting in screen that enables virtual…
erikcw
  • 697
  • 13
  • 22
4
votes
1 answer

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\Best_of_Yoshida_Brothers_|_Tsugaru_Shamisen Tried and…
Dave Jarvis
  • 235
  • 2
  • 10
3
votes
3 answers

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 program running, greps out a number then pipes that…
kirgy
  • 179
  • 10
3
votes
1 answer

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 contains this line: echo "some logging information" |…
tim11g
  • 425
  • 5
  • 9
  • 21
3
votes
1 answer

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 emails were failing, and had them send an email TO my…
neokio
  • 145
  • 7
3
votes
1 answer

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 working. I've tried the following (1) Created a…
Quasdunk
  • 179
  • 1
  • 3
  • 10
3
votes
1 answer

Postfix won't pipe to PHP file through aliases file

I'm trying to pipe from postfix to a command. According to Postfix logs it worked, but when I check the command it didn't. This is a fresh postfix install. This is my alias file: # See man 5 aliases for format postmaster: root support: "|…
jfreak53
  • 188
  • 1
  • 3
  • 25
3
votes
1 answer

transparent signals over ssh

By transparently I mean forwarding of: stdin, stdout and stderr standard signals (SIGHUP or SIGINT would be great for a start) As an example, consider these invocations of a (pointless) local and remote command: $ `cat - > /dev/null; sleep 10` <…
jnsg
  • 31
  • 1
3
votes
1 answer

pipe from tar to ftp

I have ftp access to a server I do not control. I'd like to start sending archives of my server's FS to that ftp. The problem is I don't have enough free space on my system to create a backup archive first (and store it on my fs) and then send it to…
facha
  • 1,298
  • 2
  • 16
  • 26
3
votes
3 answers

Why is ``head`` hanging and not terminating?

I have a shell script that has to find the newest file on a remote host. I have this bit: ssh -q $HOSTNAME -t ls -t -1 /path/to/somewhere/ | head -n 1 It prints the first line, then waits and doesn't terminate. However if I remove the | head -n 1,…
Amandasaurus
  • 30,211
  • 62
  • 184
  • 246
3
votes
3 answers

linux: piping data to multiple machines through ssh

I have a few terabytes of data that are processed by a tool. The output of the tool should be sent to two other machines simultaneously (simultaneously, because there's downtime while the tool runs and I want to limit the downtime). If I just pipe…
cruppstahl
  • 165
  • 5
3
votes
2 answers

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 want to write it a file, but a different file per day…
Amandasaurus
  • 30,211
  • 62
  • 184
  • 246
3
votes
2 answers

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 command when it errors does not goto stdout but to…
jinanwow
  • 443
  • 6
  • 15
1 2
3
10 11