The tag has no wiki summary.

learn more… | top users | synonyms

3
votes
0answers
623 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 ...
23
votes
7answers
14k views

Unzipping files that are flying in through a pipe

Can I make unzip or any similar programs work on the standard output? The situation is I'm downloading a zip file, which is supposed to be unzipped on the fly. Related issue: ...
1
vote
0answers
42 views

how to pipe the output of cut to the foreach command? [migrated]

I have the cut command I want that grabs the first word in each line of a file. I then want to put each word from the cut command into a foreach. I then want to do a grep command inside the body of ...
2
votes
2answers
96 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
22 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
37 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
33 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
0answers
30 views

Tar backup to webdav server: how to split the output file using stdin?

I need some advice on storing a tar file to a webdav server. I'd like to make automated backups of my VPS, however the available space is limited so I can't store the backup before uploading it to the ...
0
votes
2answers
119 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 ...
7
votes
5answers
381 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 ...
0
votes
1answer
445 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
85 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
46 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 ...
-1
votes
1answer
913 views

Piping Mail with Exim: Only Works Locally

Whenever I send an email to my catchall alias via SSH (i.e., locally), Exim successfully pipes the e-mail to a PHP script, as I told it to do. However, when I try to send an e-mail to my catchall ...
1
vote
1answer
354 views

postfix pipe to script: execvp permissions denied error

I am new to postfix and am trying to pipe a message to a particular email address to a bash script. I am running CentOS 6 in case that matters. My script has 777 permission (for testing), and when I ...
2
votes
1answer
26 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 ...
1
vote
8answers
8k 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 ...
0
votes
2answers
334 views

Postfix piping to php issue: “cannot append message to file: cannot open file: Permission denied”

I am having some issues with setting up piping to a php app (WHMCS). The mail is coming to the server however it is bouncing. The maillog shows:- May 15 12:51:14 hostname postfix/smtpd[2123]: ...
3
votes
8answers
739 views

Redirect all incoming mail into a script

I have no idea about Mail Delivery. but i need redirect ALL incoming e-mail (*@mydomain.com) into an a php script. i'm using debian Exists a simple mail server to do this? (without exim, postfix, ...
0
votes
2answers
182 views

Netcat output pipe, json parsing

What I want is this: netcat to the server, which streams json formatted loglines. pipe the output of nc to "something" that will format the json as plaintext, in a customizable format (thinking ...
7
votes
3answers
2k views

how to pipe data to sftp connection?

ftp supports the put "|..." "remote-file.name" command to pipe data to an ftp connection. Is there something similar available for sftp? In sftp i get the following error: sftp ...
5
votes
3answers
2k 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
218 views

Postfix sendmail sets original recipient

I have a postfix + dovecot with a spamassassin doing some content filtering on the postfix side. The problem is that with a recent update the originally available sendmail binary was replaced with the ...
15
votes
4answers
13k 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 ...
17
votes
1answer
828 views

Shell command slow when using pipe, fast with intermediate file

Does anyone understand this huge difference in processing time, when using an intermediate file, or when using a pipe? I'm converting tiff to pdf using standard tools on a fresh debian squeeze server. ...
1
vote
1answer
85 views

Can I use MX records to deliver some addresses to Google Apps and some to my server?

I have whm installed on my VPS, which my domain MX records are pointing to: 0:mail.mydomain.com and whm/cpanel has mail forwarding rules which pipes certain @mydomain email addresses into my CRM ...
1
vote
1answer
256 views

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 ...
0
votes
1answer
574 views

reading stdin in shell

#!/bin/sh #myVar=`date`#case 1 #myVar=`cat /dev/stdin`#case 2 myVar=($(< /dev/stdin)) #case 3 echo $myVar exit 2 case 1 works case 2 and 3 don't work. When I test with either 2 or 3; there is no ...
2
votes
1answer
190 views

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 ...
0
votes
1answer
426 views

file transfer with ssh pipe; without scp

Scenario: I'm having about hundred odd text files which are compressed as .gz. They need to be transferred to a remote server. I do not want to use scp. Both, linux servers. my requirement/my idea: I ...
1
vote
2answers
217 views

nginx - log access and error to pipe and use multilog to log rotate

What I am trying to do: Log rotate nginx access and error log using multilog My approach: Log nginx access and error to a pipe, so I can have another process that runs multilog that reads from that ...
2
votes
2answers
132 views

Adding a progress bar to a data pipe

Are there any alternatives to pv? I'd like to see the current transfer rate of a data pipe, a progress bar and an estimated completion time. Any other tools that can do that?
0
votes
2answers
406 views

Postfix bounce local delivery with source address from orig_to

I am creating a python script to deliver local mail using various means. The problem is this: This script has to accept multiple virtual domains defined in /etc/postfix/virtual The script does the ...
0
votes
2answers
195 views

Skipping a “Press certain key to continue” in a bash script

I'm installing RVM for Ruby with the following command: curl -L https://get.rvm.io | sudo su myuser -c "bash -s stable --rails" I specifically need it to be installed under that user - and it will ...
0
votes
1answer
326 views

WATCH command with pipes

Hithere, how do I watch this command: netstat -plan|grep :80|egrep -v "(:8082)|(:8080)|(:8081)"|awk {'print $5'}|cut -d: -f 1|sort|uniq -c|sort -n It errors out when surrounding it with single/double ...
1
vote
2answers
244 views

Continual tailing and sorting of multiple files on linux?

Is there a way to use pipes or FIFO in combination to continually monitor several (same format) log files whilst sorting on the first field and then being able to effectively do a tail -f on that ...
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/' ...
2
votes
1answer
415 views

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 ...
0
votes
1answer
1k views

Postfix “mail-to-script” pipe only delivers empty messages

i have a problem here. I want that a incoming email is piped to a php script in the system through postfix. My System is running with ispconfig 3, postfix and dovecot (< virtual mailbox users are ...
2
votes
6answers
517 views

Pass a pipe to a command that expects a filename

Say I have a command foo which takes a filename argument: foo myfile.txt. Annoyingly, foo doesn't read from standard input. Instead of an actual file, I'd like to pass it the result of another command ...
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 ...
0
votes
1answer
744 views

syslog-ng not flushing the pipe to external program (SOLVED)

I have written a python script that takes log entries from syslog-ng and writes them to MongoDB (I couldn't do it with afmongodb driver because I need to do some special processing). This is how it ...
2
votes
2answers
1k views

Why is this tee losing stdout?

Simple script: #!/bin/bash remote_ssh_account="depesz@localhost" directory_to_tar=pgdata exec nice tar cf - "$directory_to_tar" | \ tee >( md5sum - | \ ssh ...
4
votes
1answer
158 views

How to concatenate streams?

I know cat can concatenate files, but I need to concatenate a mix of files and streams and pipe the result to another process. To make the question more concrete, I want to concatenate cat abc.sql ...
1
vote
3answers
116 views

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 ...
2
votes
3answers
115 views

is it safe to pass passwords in plaintext to a script if you use subshells?

I have a script and it does a read -p to a variable named PASSWD: smbclient -L 192.1.1.1 -U username%$PASSWD I believe that I won't be able to see this in the history. On this link, it says that ...
-1
votes
1answer
145 views

why does pipebackand always return ANY qtype?

when sent a query dns to pdns with type equal A , the latter sent to pipe backend using pipe protocl and qtype always egual ANY why?i use powerdns 2.9.22 and my os is ubuntu thank you in advance
0
votes
1answer
286 views

Enabling Pipe(|) functionality with Postfix for a .forward file

I'm running into an issue trying to get pipe forwarding working on postfix. Rather than running the script I'm intending to run, it's appending to my script. Testing on other servers this seems to ...
0
votes
1answer
158 views

Postfix, set privileges for piping

I configured postfix on my box to call a php script on incoming e-mails, using virtual aliases. The script is being called, but it runs as "nobody" and thus I can't send signals to another program ...
3
votes
3answers
226 views

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 ...