Sponsored Content
Full Discussion: Looping through input/output
Top Forums UNIX for Beginners Questions & Answers Looping through input/output Post 302979955 by zajtat on Monday 22nd of August 2016 09:22:23 AM
Old 08-22-2016
To solve this issue of mine, I've done something not very elegant: I've written 5.427 commands with all the files to merge and just made an executable file with all the commands copy pasted there. This is how it looks like (for the first 11 files):

Code:
./match.pl  -f 9464294024_R01C01header -g 9466656017_R01C01header -k 1 -l 1 -v "5 6 7" > ./result/1
./match.pl  -f 9464294024_R01C02header -g ./result/1 -k 1 -l 1 -v "5 6 7" > ./result/2
./match.pl  -f 9464294024_R02C01header -g ./result/2 -k 1 -l 1 -v "5 6 7" > ./result/3
./match.pl  -f 9464294024_R02C02header -g ./result/3 -k 1 -l 1 -v "5 6 7" > ./result/4
./match.pl  -f 9464294024_R03C01header -g ./result/4 -k 1 -l 1 -v "5 6 7" > ./result/5
./match.pl  -f 9464294024_R03C02header -g ./result/5 -k 1 -l 1 -v "5 6 7" > ./result/6
./match.pl  -f 9464294024_R04C01header -g ./result/6 -k 1 -l 1 -v "5 6 7" > ./result/7
./match.pl  -f 9464294024_R04C02header -g ./result/7 -k 1 -l 1 -v "5 6 7" > ./result/8
./match.pl  -f 9464294024_R05C01header -g ./result/8 -k 1 -l 1 -v "5 6 7" > ./result/9
./match.pl  -f 9464294024_R05C02header -g ./result/9 -k 1 -l 1 -v "5 6 7" > ./result/10

I've used numbers to name the output files as it was easier to loop them for writing. The commands work without any problem. And I've got my output.

I must admit that I do not understand the script you've provided, nor the diagnostics (I'm a beginner, posting in the forum for beginners) and, thus, cannot comment on your statement of your script working or what the diagnostics say. I'm grateful for your time and help, but am a bit baffled as to why the general consensus is that the only possible explanations to this situation are in two possibilities (1) my perl script having a problem or (2) I'm not providing truthful/good information.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Using Output from one command as input to another

This site has been very helpful thus far.. I thank you all in advance for sharing the knowledge. Let me get to it. I am trying to write a very small script to take away from the boredom of doing the same thing over and over. Everynow and again I have to get the hex value of a file using a... (2 Replies)
Discussion started by: BkontheShell718
2 Replies

2. UNIX for Advanced & Expert Users

input/Output settings

How can we view all the input/output settings of unix environment for a session (6 Replies)
Discussion started by: paritoshc
6 Replies

3. Shell Programming and Scripting

input -output file

Hi, I am having an Input file .which is having a list of names. comapring with our database , needs to write the out put in file called output.txt , format should be name--> country--->phone number could you please help me.. thanks in advance (7 Replies)
Discussion started by: hegdeshashi
7 Replies

4. Shell Programming and Scripting

perl: looping through the output of a 'system' command

Hi there could anybody point me in the right direction when it comes to looping through the output of a system command in perl (i.e. df -k) doing a test against each line to see if it matches? for example if i have a df -k output like this and I wanted to grab the lines that matched "sda" or... (3 Replies)
Discussion started by: rethink
3 Replies

5. Shell Programming and Scripting

Dynamic output file generation using a input text file with predefined output format

Hi, I have two files , one file with data file with attributes that need to be sent to another file to generate a predefined format. Example: File.txt AP|{SSHA}VEEg42CNCghUnGhCVg== APVG3|{SSHA}XK|"password" AP3|{SSHA}XK|"This is test" .... etc --------- test.sh has... (1 Reply)
Discussion started by: hudson03051nh
1 Replies

6. Solaris

SVM Solaris 8 Problem. Metastat output looping

Hi friends, I'm newbie to SVM. Just wanna try installed it on one of our server (to do mirroring for disk0 and disk1) but i think im lost until now. :( the steps i've taken is as below:- 1.prtvtoc /dev/rdsk/c1t0d0s2 | fmthard -s - /dev/rdsk/c1t1d0s2 2.metadb -a -c 3 -f c1t0d0s7... (3 Replies)
Discussion started by: kronenose
3 Replies

7. Shell Programming and Scripting

Looping through for user input

Legends, I want to remain in the script until user passes the correct name. I had tried the below code; but it didn't work out. Please help echo "\nPlease enter the source system: \c" while read SYSTEM_NAME do if ]; then echo "\nMaking $SYSTEM_NAME as source system for particular... (5 Replies)
Discussion started by: sdosanjh
5 Replies

8. Shell Programming and Scripting

looping and saving output of each line separately

I have been trying this program for a long time. I am trying to read a file named "odon" line by line; read the first line, send it to do a command saved in a file "perm", once the first line has finished going through the content of the file perm, the result is saved with the number of the line.... (17 Replies)
Discussion started by: iconig
17 Replies

9. UNIX for Dummies Questions & Answers

Looping through the contents of array for output name

Hi all, I am trying to loop through the string contents of an array, to add it during the saving of the output files. I am trying this code to print each column and save it to unique file name, but it doesn't work. Thanks for any help. fnam=(japan usa uk) alldata.dat contained sample data... (1 Reply)
Discussion started by: ida1215
1 Replies

10. Shell Programming and Scripting

Looping over output of 'ls'

Hi, I have some output from 'ls' command and I want to loop over the output in a bash script. What would be a good way to go about it? For example, if the output of the ls command gives me 'prefix1 prefix2 prefix3', how can I set a loop that will iterate over these? many thanks! (5 Replies)
Discussion started by: pc2001
5 Replies
pstopdf(1)						    BSD General Commands Manual 						pstopdf(1)

NAME
pstopdf -- convert PostScript input into a PDF document. SYNOPSIS
pstopdf [inputfile] [-o outname] [-l] [-p] DESCRIPTION
pstopdf is a tool to convert PostScript input data into a PDF document. The input data may come from a file or may be read from stdin. The PDF document is always written to a file. The name of the output PDF file is derived from the name of the input file or may be explicitly named using the -o option. Flags: -o outname The name of the output file to create. If an explicit file name is not supplied, the output file will be created in the current directory and named foo.pdf for an input file named foo.ps -l Specifies that any messages generated during file conversion be written to a log file. For an output file named foo.pdf the generated log file is foo.pdf.log rather than generated to stdout. If there are no messages, the log file is not generated. -p Generates a simple progress message to stdout at the end of each page. Because conversion of complex or lengthy PostScript input can take time, it is sometimes useful to see that progress is being made. Progress messages are always written to stdout even when the -l (log file) option is specified. EXAMPLES
pstopdf inputfile.ps Creates a PDF file named inputfile.pdf from the PostScript data in the input file inputfile.ps pstopdf -o outputfilename Creates a PDF file named outputfilename from the PostScript data read from stdin. Apple Computer, Inc. May 31, 2019 Apple Computer, Inc.
All times are GMT -4. The time now is 03:54 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy