ok I spent ages on my reply and then lost it when trying to post, so here it is again. bah...
You had asked
Quote:
You have told us a lot about which lines were messing up, but what's less clear is what you'd want the program to be doing, if it were working.
Apologies for not being totally clear. I currently have a bash script that is run from a project directory location that contains many Sample directories. The script contains a for loop that is running three third party tools on files in each Sample Directory. I have added a loop within this loop (probably bad form!) to pull a file ('summary.txt') from one program output directory for each sample and print all summary.txt files to a single .txt. Lastly, I direct all stout from the script to a second .txt file.
I would like select specific lines from stout for each sample (or iteration of the loop), and print with each summary.txt, so that I get a report for all Samples for QA purposes. This would need to be in order of Sample processing through the loop to be readable, for Example: sample 1 stout lines, sample1 summary
sample 2 stout lines, sample2 summary.....
This output text file would look something like this (THIS IS OUTPUT FROM CODE, NOT CODE!):
Now, I can put all summary files in a single .txt and pull the whole stout to a second .txt, but have not been able to select stout lines within the loop and iterate with printing the summary.
All suggestions welcome!
Moderator's Comments:
CODE tags should be used whenever you are displaying sample input, sample output, and code segments; not just code segments!
Last edited by Don Cragun; 08-11-2014 at 02:03 PM..
Reason: Put CODE tags back in!
In bash, I need to send the STDOUT and STDERR from a command to one file, and then just STDERR to another file. Doing one or the other using redirects is easy, but trying to do both at once is a bit tricky. Anyone have any ideas? (9 Replies)
Is there a way to redirect all stdout to a file implicitly - like defining stdout=/home/me/process.log - so that all "echo" commands in several scripts/subscripts are written to that file; instead of having to edit all scripts to redirect the "echo" (e.g. echo 'This is a test ' >>... (1 Reply)
Hi,
I am trying to execute a command like this:
find ./ -name "*.gz" -exec sh -c 'zcat {} | awk -f parse.awk' \; >> output
If I want to print the filename, i generally use the -print argument to the find command but when I am redirecting the output to a file, how can I print just the... (2 Replies)
I have an executable that, depending on its input, outputs to either one file or several. It usually prints nothing on screen. The usual way to call this program is to specify an input and output filenames, like this:
./executable.exe -i inputfile -o outputfileIt will then try to use the output... (1 Reply)
can anyone help me in making singleline command for
Capital Letters are folders ,small letter are files
X,Y,Z are subfolders of A
as shown below
A - X,Y,Z
Folder X has three files a.txt,b.txt,c.txt similarly Y,Z.
as shown below
X- a.txt,b.txt,c.txt
Y- a.txt,b.txt,c.txt
Z-... (4 Replies)
Hi everybody,
I am trying to do the thing you see in the title, and I can't simply do
a=$(svn up)
echo $a
because the program (svn) gives output on lots of lines and in the variable the output is stored on only one line (resulting in a horribly formatted text). Any tips?
Thanks,... (2 Replies)
Hello,
I have a script (videostream.sh) which invokes the GStreamer command-line tool gst-launch with all the correct command line parameters. When I invoke this program, I add the '&' character at the end to make it a background task, so that my script can complete and exit, i.e.
gst-launch... (1 Reply)
I have a simple bash script that prints sth every 5 seconds. What I do is the following. I redirect the output of the script to a file, tail the file and see that it works and then from another console I delete the file where the output is redirected to. Even though I have deleted the file, the... (2 Replies)
I have a C program that continously outputs info to stdout. The problem is that I am redirecting the stdout and stderr to a file and stdout is written at the end of the problem rather than continously to the file. This could be a problem if for example the program is killed and the stdout output is... (3 Replies)
Hello,
I'm strugling with some redirecting and all help is apreciated.
The following program is working as expected, but the result of the AT command doesn't go to any file.
Thanks in advance for the help.
#!/bin/bash
modem=/dev/ttyUSB1
file=/root/imsi.txt
# print error to stderr and exit... (4 Replies)