How to run this program with only one input file at a time


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to run this program with only one input file at a time
# 1  
Old 01-10-2009
Question How to run this program with only one input file at a time

i have a program ABC, which runs every two minutes and takes the input according to the a value called "pointer"

files need to be processed by ABC are

input0001
input0002
input0003
input0004
input0005

current value of pointer is 0001, now program runs and takes all the files from input0001 onwards and processes all till input0005.

i want to process only one file in each run of this program, instead of all in single run.

i have only the right to rename the input files and process them one by one. if i'll make input0002 to input0002.stop , program will stop, but how to resume it back, and rename all files one by one. i cant make any change in the program. plz help
# 2  
Old 01-10-2009
Quote:
Originally Posted by Prat007
i have a program ABC, which runs every two minutes and takes the input according to the a value called "pointer"

Where does it get that value?
Quote:
files need to be processed by ABC are

input0001
input0002
input0003
input0004
input0005

current value of pointer is 0001, now program runs and takes all the files from input0001 onwards and processes all till input0005.

i want to process only one file in each run of this program, instead of all in single run.

If you have "pointer" in a variable, use it:

Code:
pointer=0001

do_whatever "input$pointer"

# 3  
Old 01-10-2009
I'm not clear on something: How do you provide ABC with the value of "pointer"? And does ABC figure out that if it sees file input0001 that it should continue with input0002 and then with input0003 etc? Do you have the permission to create a softlink? Try it with:
Code:
ln -s input0003  single-input

and provide "single-input" to the program ABC.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to take the file name in run time using shell.?

I want to take the file name as an input to the program and copy that file into new location using shell. Below program is not working properly. #!/bin/sh if ; then `/usr/bin/perl -pi -e's/(notifications_enabled\s*)(\d+)/$sub = "$1" . ("$2"== "0" ? "1":"0")/e; ' $file` `cp... (2 Replies)
Discussion started by: praveen265
2 Replies

2. Shell Programming and Scripting

Run a program-print parameters to output file-replace op file contents with max 4th col

Hi Friends, This is the only solution to my task. So, any help is highly appreciated. I have a file cat input1.bed chr1 100 200 abc chr1 120 300 def chr1 145 226 ghi chr2 567 600 unix Now, I have another file by name input2.bed (This file is a binary file not readable by the... (7 Replies)
Discussion started by: jacobs.smith
7 Replies

3. Shell Programming and Scripting

How to give a text file as input while running a program?

Hi Friends, I am running a program /path/to/program -i 1 100 -o /path/to/output/op_1_100.txt In the above command, I have to try various number of combinations at the -i parameter and the output file name varies with each combination. Now, I have my -i parameter text file, which is like... (4 Replies)
Discussion started by: jacobs.smith
4 Replies

4. Shell Programming and Scripting

Need help to run sql query from a script..which takes input from a file

I need to run sql script from shell script which takes the input from a file and contents of file will be like : 12345 34567 78657 and query will be like : select seq_nbr from bus_event where event_nbr='12345'; select seq_nbr from bus_event where event_nbr='34567'; select seq_nbr... (1 Reply)
Discussion started by: rkrish
1 Replies

5. Shell Programming and Scripting

Help to write a script or program to automatic execute and link input file data

Output file template format <input_file_name>a</input_file_name> <total_length_size>b</total_length_size> <log_10_length_size>c</log_10_length_size> Input_file_1 (eg. sample.txt) SDFSDGDGSFGRTREREYWW Parameter: a is equal to the input file name b is equal to the total length of... (2 Replies)
Discussion started by: perl_beginner
2 Replies

6. Shell Programming and Scripting

Shell script to run a python program on multiple entries in a file

Hello I am trying to run a python program using shell script, which takes a single argument from a file. This file has one entry per line : 1aaa 2bbb 3ccc 4ddd 5eee ... ... ... My shell script runs the program, only for the last entry : #!/bin/sh IFS=$'\n' for line in $(cat... (2 Replies)
Discussion started by: ad23
2 Replies

7. Shell Programming and Scripting

Can process substitution be used as an input file to another program?

Hey, I was trying to figure out how to launch a program from the command line, and it works if you pass it a config file. I was thinking about writing a script to dynamically create the config file and pass it to the command using something like command substitution (so I don't actually have to... (3 Replies)
Discussion started by: bj0
3 Replies

8. UNIX for Dummies Questions & Answers

(Beginner) Run c++ .exe with input to file

Hi, I've got this requirement for my homework assignment, but I'm not sure how to meet it: In the comamnd line, I need to type $ <exec-file> <input> <output_file_name> Like: test 1+2 out.txt Which should execute test.exe passing in 1+2 and directing output to out.txt. I know how... (1 Reply)
Discussion started by: JustinT
1 Replies

9. Shell Programming and Scripting

File path with space as external input to the program

Hello I am getting error when the file (Folder or Application) path having space is given as external input to the shell program. It works fine for the files which has no spaces in the file name Thans, (5 Replies)
Discussion started by: keshav.murthy@r
5 Replies

10. UNIX for Dummies Questions & Answers

Run a program for every file with a given extension

Hey all I have written a python program that takes as input the name of a data file with the extension .lc I would like to write a shell script that finds all of the .lc files in a set of branching directories and runs the program. Any help? (5 Replies)
Discussion started by: Phobos33
5 Replies
Login or Register to Ask a Question