Instead of a steady output of lines to the terminal, output only occurs after a few seconds, between 6 or 12. This happens whether the input is from mplayer or avconv/ffmpeg. This never used to happen (a few years ago) so I wondered whether an awk update caused this to happen.
I want to have the output of a program go to 2 different files but not going to standard out. Is there a way to do this in bash? I know that in Z shell its really easy. omething like: Code: echo "test" >> file1 >> file2 Would work. But in Bash it doesn't seem that easy. I know that tee will send the output to 2 files but it also sends it to STDOUT.Something like:Code: echo "test" | tee -a file1 file2 Would put the word "test" in file1, file2, and STDOUT. Is there a way to just send the output to file1 and file2?
I have a script where I want to redirect stdout to the terminal and also to a log file aswell as redirecting stderr to the same log file but not the terminal.I have the following code which I found on the net which redirects both stderr and stdout to a file and the logfile,
I am writing a script that calls a program which writes a lot of lines to stdout continuosly. If the last line in stdout has some regex, THEN, certain variables are updated. My problem is that I don't know how to do that.
A simplified example would be (it's not my exact case, but it I write it here to clarify): suppose I issue a ping command (which writes output to stdout continuously). Every time that the response time is t=0.025 ms, THEN, VARIABLE1=(column1 of that line) and VARIABLE2=(column2 of that line).
I think the following code would work in awk (however, I want the variables in bash and I don't know how to export them)
In the previous code, awk analyzes each line of the output of the ping command as soon as it is created, so the variables $var1, $var2, ... are updated at the appropriate time. But I need the "real-time" updated values of $var1, $var2 in bash, for later use in the script.
Code: stuart@stuart:~/$cat showthread.php.html | grep -o [URL][^"< ]*" | uniq | head -n3 | plowdown - cannot stat '-': No such file or directory Code: stuart@stuart:~/$ awk NR==$x Musiclist.txt | cut -d/ -f6 | basename $1 .mp3 .mp3 Here's some system info on the bash i'm using:
I have a server client prog in which server is my 'agent' and client is 'manager'. Following is the code for both agent and manager. I want my agent to send what manager is requesting. But it is not working the way I want. The parameters which manager is requesting, agent has to send to manager but in this program result for those parameters is shown on agent's own terminal window. Where as I want them on manager's window. Secondly, there result is not correct, means it is giving ' 0 K ram and 0 no of process....
at this point I want to redirect what I have in hand to a file but also ... fork? or split? whatever the term, to continue onward so that I can pipe the results further into wc -l or sort or programX. without having to re-loop through that huge log file.
Every time I open my terminal a warning message shows up. The warning is the following:
Code: Select allwarning: output DFP2 not found; ignoring
There is no output DFP2 in my system. I ran xrarndr and the outputs are the following:
Code: Select allScreen 0: minimum 320 x 200, current 3840 x 1080, maximum 8192 x 8192 VGA1 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 477mm x 268mm 1920x1080 60.00*+ 1680x1050 59.95 1600x900 59.98 1280x1024 75.02 60.02
HDMI1 disconnected (normal left inverted right x axis y axis) DP1 disconnected (normal left inverted right x axis y axis) HDMI2 connected primary 1920x1080+1920+0 (normal left inverted right x axis y axis) 477mm x 268mm
I have a little complex Makefile system. A parent Makefile call dozens of Makefiles in subdirctories. And the subdirctory Makefile calles shell script to do real building. I want to grab all output this Makefile system generate. So, i employ "make 2>&1 > make.log". but not all output messages are filed into make.log. The message generated by sub-makefile called shell script cannot be recorded into make.log. And another curiouse thing is, if i launch "make 2>&1 > make.log" in a perl script, all output do be sent into make.log.
I'm trying to write a program that will fork a series of FTP sessions. For each session, there should be separate input and output files associated with stdin and stdout/stderr. I keep reading how I should be able to do that with dup2() in the child process before the execl(), but it's not working for me. Could someone please explain what I've done wrong? The program also has a 30-second sniper alarm for testing and killing of FTPs that go dormant for too long.
The code: (ftpmon.c) #include <stdio.h> #include <stdlib.h> #include <string.h>
$ ftpmon Connected to gila-crstest.gilacorp.com (172.16.20.8). 220 (vsFTPd 2.0.1) ftp> waitpid(): Interrupted system call
Why am I getting the ftp> prompt? If the dup2() works, shouldn't it be taking input from my script and not my terminal? In stead, it does nothing, and winds up getting killed after 30 seconds. The log file is created, but it's empty after the run.
I'm working on an application used for backup/archiving. That can be archiving contents on block devices, tapes, as well as regular files. The application stores data in hard packed low redundancy heaps with multiple indexes pointing out uniquely stored, (shared), fractions in the heap.
And the application supports taking and reverting to snapshot of total storage on several computers running different OS, as well as simply taking on archiving of single files. It uses hamming code diversity to defeat the disk rot, instead of using raid arrays which has proven to become pretty much useless when the arrays climb over some terabytes in size. It is intended to be a distributed CMS (content management system) for a diversity of platforms, with focus on secure storage/archiving. i have a unix shell tool that acts like gzip, cat, dd etc in being able to pipe data between applications.
dd if=/dev/sda bs=1b | gzip -cq > my.sda.raw.gz
the tool can handle different files in a struct array, like:
Is there a better way of getting the file name of the redirected file, (respecting the fact that there may not always exist such a thing as a file name for a redirection pipe). Should i work with inodes instead, and then take a completely different approach when porting to non-unix platforms? Why isn't there a system call like get_filename(stdin); ?
If you have any input on this, or some questions, then please don't hesitate to post in this thread. To add some offtopic to the thread - Here is a performance tip: When doing data shuffling on streams one should avoid just using some arbitrary record length, (like 512 bytes). Use stat() to get the recommended block size in stat.st_blksize and use copy buffers of that size to get optimal throughput in your programs.
I'm writing a script to execute bash commands in the PHP CLI. I would like to suppress errors from bash and write my own error message if an error occurs. So far I have this (assuming log.txt doesn't exist!):
tac log.txt 2>/dev/null
Which works as expected, tac kicks up an error but the error is suppressed, but when I use this:
tac < log.txt 2>/dev/null
bash: log.txt: No such file or directory
The tac error is suppressed but bash still gives me a dirty error.
hello I tried to find a good subject but it was the best of mine, anyway I'll explain it here. some time I do some thing like installing a new application in Linux terminal of my office PC but it take a long time and I have to go home during its installation or configuration process that it is not good to cancel it.My current solution is abandoning the process until next day. I wanted to know is there any way to redirect an input and out put of a terminal to another one, if it works I can continue my abandoned process by ssh to my Linux office PC and redirect that terminal to my new remote sshed terminal from my home.
Running debian wheezy. I noticed recently, whenever I fork a process using "&" from a terminal, such as
Code: Select allleafpad &
it starts up, shows the processid in the terminal, but every time when I close the terminal, leafpad gets killed. However, I create a simple bash script,
Code: Select all#!/bin/bash leafpad& exit
The script launches leafpad, then exits out leaving leafpad running, as it should. Is what I mentioned above normal? I'm confused, because I think I used to be able to do this in terminal without it depending on the terminal to stay running.
I guess I'm remembering wrong. As it turns out, commands begun on terminal get closed with terminal unless, as mentioned, you use nohup or start subshell. Process hierarchy and tracking etc.
if you do the command conky in terminal, it starts conky ofcourse, but it also shows output to that terminal so you can't do any other commands to that terminal, Is their an option like you can do with the '&' sign in other cases? If you do the '&' sign with conky it still gives output, also the conky -d command gives output...
Is there a simple way to save a video that appears in the /tmp directory as a pipe instead of a video file format? I was watching some of the old educational films on fluid dynamics from t the only evidence I see of a fileaSL_PIPE_500_SingleOfficeIPC_ff7ed09f7cfaad13bfa22 2a40c3fd37
I am doing this project for our school. Basically we want to pipe all incoming emails to a script which filters out certain messages (not only spam but duplicates, large messages, etc). If they fail certain criteria, the script simply does nothing.If they pass , then the script should pass the entire message (headers and body) back on to qmail to send. The piping part is not a problem, but I am stuck with the next part. Is there a way to pass the headers and body back to qmail for it to process and send, as if it received it the first time?Some details:A catchall email account is created via Plesk control panel on linux (centos).THe .qmail file in /var/qmail/mailnames/domain.com/catchall/ is edited to include the line:-|/path/to/pipe/handler.phpThe handler.php file simply reads the entire message (headers and body) and they are then parsed and analysed.
First things first: I'm running F12 KDE and yum informs me that I'm fully up to dateI'm having a problem where the second sound that my computer plays stutters - this is best seen in amarok, the first track will play fine but the second track will stutter and play really slowly. I asked on IRC and the suggestion came back that it was possibly due to this bug[URL]
although VLC playback triggers it, I suspect it's actually a kernel problem. After moving from 10.04 x64 to 10.10 x64, I've been noticing the following problem: When watching a DVD .iso using VLC Media Player, the system will become "jerky" and "stutter" after a random amount of smooth playback. At that point, the only way to make the system smooth and responsive again is a hard restart (normal shutdown hangs and refuses to complete).where I can start looking to find where the bug lies? My laptop is an Acer Aspire 6930 with 10.10 x64 and the current NVidia display driver.
I am running a Java application on the command line bash terminal under Mint Debian. I have JDK1.6.0_22 installed 64-bit, and the OS is 64-bit too. I have a few JAR files in the directory and a few native LWJGL libraries. When I run the application using the command line, all works fine. Lets assume my directory where the files are is called /home/riz/MyGame. I change to that directory and this is the command I use code...
I would like to keep this simple and if possible use a piped command as opposed to an all out complex method.I have a script that does many things for me, and one of them builds a basic simple system report (I know about lshw, but this is for me to learn as well as be functional)
I would like to add another pipe to remove the"model name:" portion.I do not really want to use the store in a variable first solutions if I can help it.