The tag has no wiki summary.

learn more… | top users | synonyms

1
vote
3answers
164 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
159 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
173 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
401 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
254 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
272 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 ...
1
vote
1answer
362 views

How to run truss with piped command in Solaris

How to run a truss command with piped output? eg. # truss -leDo /tmp/truss.out tar cvf - dirs/ | gzip -1 > archive.tar.gz I get only the "tar" output in truss, not from gzip!
0
votes
1answer
224 views

Forward mail to mailbox in addition to piping

I've set up postfix to pipe emails through rdm-mailhandler.rb (redmine), but I'd also like the emails to be delivered to the mailbox. transport: support@myhost.com redmine master.cf: redmine ...
0
votes
2answers
3k views

Piping in postfix/aliases [duplicate]

Possible Duplicate: How to configure postfix to pipe all incoming email to a script? I'm having problems setting up simple piping for Redmine (or '|cat > /tmp/temp') /etc/postfix/virtual: ...
1
vote
3answers
376 views

How to get the output of a php script executed by a piped mail?

I've configured an email address to pipe (forward) all emails to /path/to/script.php I thought I'll receive the output of the script as an email reply but it doesn't work. How can I get the output ...
3
votes
2answers
150 views

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 ...
4
votes
5answers
1k views

Bash: Execute piped lines from stdin

I haven't found a solution to this after some searching. I think the search terms are just too general. I'd like to know how to execute a number of lines (at the bash prompt) which are generated by ...
5
votes
2answers
5k views

How do I pipe the output of uptime/df to curl?

I want to send the output of uptime and df commands to a web app using cURL. I tried: uptime | curl http://someurl.com -T - But that didn't seem to send the data. What is the proper way to send ...
3
votes
2answers
337 views

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 ...
2
votes
1answer
910 views

pipe multiple files, single ssh connection, remote commands

I'd like to pipe several files to a remote server, piped as input to commands run on the remote server, over ssh, but only one ssh connection/command is permitted. (In the remote authorized_keys file, ...
0
votes
1answer
1k views

Why is this apache php piped log script not working properly?

i have a piped logging program like this: #!/usr/bin/php <?php $fd = fopen("php://stdin", "r"); while(true) { $l = fread($fd,8192); $l = trim($l); if($l =="") continue; ...
7
votes
1answer
1k views

using temporary files vs pipes advantages and disadvantages

Say I have a file named jobs.csv and I would like to get the top 50k jobs done by Foo I can either do: # cat jobs.csv | sort -u | head -n 50000 > /tmp/jobs.csv # cat /tmp/jobs.csv | while read ...
7
votes
3answers
5k views

How can I handle spaces in file names when using xargs on find results?

One of my common practices is to perform greps on all files of a certain type, e.g., find all the HTML files that have the word "rumpus" in them. To do it, I use find /path/to -name "*.html" | xargs ...
3
votes
0answers
862 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 ...
0
votes
3answers
591 views

how to “batch” output of “tail -F” or output all data in a stream every X seconds?

I am trying to monitor a log file in real-time. Say I issue a command such as: tail -F mysystem.log|grep -i error|mail ... This is supposed to monitor my log file, every time it sees an error, email ...
0
votes
2answers
80 views

Piping emails from a development server to a text file

Is there a way to capture all mail from a unix server and pipe it to a log file? Or maybe at least all mail from PHP? I know of a trick where in php.ini sendmail is tricked byt this line: ...
0
votes
2answers
459 views

How pipe email to PHP with Maildirs

I used to pipe incoming emails using: |/path/to/php/script in .forward file at /home folder. But the actual system I'm working on is based on Maìldir instead MBOX. So that solution does not work. I ...
1
vote
1answer
111 views

receiving two emails to virtual alias

have a virtual alias setup in /etc/postfix/virtual that reads: @mydomain.com mydomainincoming I then have a pipe setup in /etc/aliases that reads: mydomainincoming: ...
1
vote
3answers
1k views

forward all mail on a specified domain to script

I run a disposable e-mail service that accepts all incoming mail and forwards it to a PHP script that stores it in a database for people to view. Before now, I have been on shared hosting with cPanel, ...
11
votes
3answers
1k views

On Linux, how can I see how far through a file a process is?

If I have a piped command such as cat myfile | processor_application where processor_application is something reading from standard in, in chunks, to process, is it possible to see how far ...
5
votes
3answers
4k 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 ...
1
vote
1answer
829 views

How do I copy stdout and stderr into a log file in Windows XP?

I have a script that I'm running from a command line. I want the stdout and stderr to be displayed on the screen and also to be copied into a logfile with append. What is the syntax for this ...
2
votes
2answers
641 views

Bash Parallelization of CPU-intensive processes

tee forwards its stdin to every single file specified, while pee does the same, but for pipes. These programs send every single line of their stdin to each and every file/pipe specified. However, I ...
0
votes
3answers
1k views

Hang and broken pipe when rebooting over ssh

I'm trying to reboot one box from another, using the following command: ssh 10.0.0.26 'reboot --force' I expect this to block for a short while until the other box reboots, then return. What I see ...
3
votes
1answer
966 views

Capturing STDERR and STDOUT to file using tee

I'm unclear what the best order is to capture both STDERR and STDOUT to the same file using tee. I know that if I want to pipe to a file I have to map the filehandle after the redirect, i.e. find . ...
1
vote
4answers
1k views

Is there an easy way to insert data/time in front of a log file with just shell scripting?

Say I want to monitor memory usage on a java process overnight. I can do something like top | grep java > out.log I will get a log file with a whole bunch of lines. Is there an easy way to get a ...
0
votes
1answer
145 views

How to display results without two first lines

When I run some bash command it returns 2 .. n lines of text (n is different each time, may contain blank lines). How to filter the output to display the result skipping lines 1 and 2? e.g. $ ...
1
vote
1answer
844 views

Non-blocking bash redirection

Does anyone know how to redirect the output of a program, running from a bash script, to a named pipe IN NON BLOCKING MODE (having 'O_NONBLOCK' flag set)?
0
votes
1answer
2k views

Is there any limit to AIX 5.3 pipe size?

I'm in trouble while performing cat/tail/head operation on large files on Aix 5.3. When asking for a cat of several 1Go file redirected to another one: cat file1 file2 file3 > outputfile The ...
1
vote
1answer
610 views

sed can't find a file that obviously exists

I run the following command which comments out all lines that contain the text "dlclose" grep -lIR "dlclose" . | grep -v ".svn" | xargs sed -i "s/.*dlclose.*/\/\/&/g" However, sed claims that ...
1
vote
1answer
359 views

Comment all lines matching some pattern

I need to comment out all lines containing "dlclose" for each file in the current directory and any sub-directories (recursively). This is my best guess so far given what I was able to find out from ...
2
votes
2answers
625 views

Pipe email from google apps to server php script

I'm wondering if anyone here would have any ideas on how I can pipe support@domain.com to our ticket system on our server with our email being hosted via Google Apps. Is it possible to pipe a ...
1
vote
3answers
3k views

Scripting (piping) commands into a telnet session

i use a cronjob to execute a filetransfer to a host and then telnet into the host and pipe some commands into it. HOST=somehost USER=postgres PASSWD=blabla ftp -n -v $HOST <<END_SCRIPT quote ...
1
vote
2answers
321 views

Top like viewer eating tail -f stream

Hi there I'm searching for a command line tool working with a stream of lines (tail -f typically) and counting them like : tail -f /var/log/apache2/access.log | cut -d' ' -f1 | SOME_COMMAND and ...
0
votes
1answer
199 views

how to check open ports of bunch of website at once with nmap/linux?

I want to use nmap in such a way that I could check bunch of server's port at once for checking whether their particular port is open or not? right now I have 10 ip addresses but in future this could ...
0
votes
1answer
227 views

Does Apache spawn piped logger on each HTTP request?

I am examining a high-volume Apache prefork site and noticing that many log entries such as: CustomLog '|/foo/bar/cronolog -foo -bar' RewriteLog '|/foo/bar/cronolog -bar -foo' When apache logs the ...
4
votes
4answers
143 views

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? ...
1
vote
8answers
11k 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 ...
1
vote
1answer
301 views

Exim 4 pipe select command/script from mysql db

Is there an option to run a mysql lookup in the pipe driver of exim? MYSQL_Q_SCRIPT=SELECT script FROM MYSQL_EMAILTABLE WHERE domain='${quote_mysql:$domain}' AND ...
4
votes
1answer
511 views

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: ...
2
votes
2answers
263 views

Pipe program output into a protected file using sudo

I want to do the following: $ echo "secrets" > protected_file But the the problem is, I don't have file permissions for "protected_file", so I try the following: $ sudo echo "secrets" > ...
1
vote
2answers
3k views

Updating a file in a zip archive from STDIN

I want to update/freshen a file in a zip archive with the contents of stdin. So far I haven't been able to find a way to tell the zip command that the contents of stdin correspond to a particular ...
2
votes
3answers
3k views

Count number of bytes piped from one process to another

I'm running a shell script that pipes data from one process to another process_a | process_b Does anyone know a way to find out how many bytes were passed between the two programs? The only ...
0
votes
3answers
1k views

Bash piping answer in Ubuntu

In a bash script, I want to know know how to pipe in answers like for example: ssh -l username -i /home/ubuntu/.ssh/id host.com < yes The ssh connection would ask if I would like to continue the ...
1
vote
1answer
2k views

How to ask exim4 to redirect some email pattern to a specific email address?

I would like to redirect all email from *@domain.fr to username@gmail.com Do you know how I can configure my exim4 server on Debian to do so ? (My exim configuration seams to be split in different ...