Run sequential test files


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Run sequential test files
# 1  
Old 02-24-2016
Run sequential test files

I have c program that I run like this:

Code:
./a.out t1

And my test files look like this all the way up to 100:

Code:
t1
t2
t3

Is there a way to run this more efficiently so I don't have to hit up and change the number every time?
# 2  
Old 02-24-2016
How about using a for or a while loop?
# 3  
Old 02-24-2016
Quote:
Originally Posted by RudiC
How about using a for or a while loop?
I would I do that? I'm not very good with shellscripts.
# 4  
Old 02-24-2016
Hi,

Try this;

Code:
for i in `ls t*`
do 
a.out ${i}
done

Regards

Gull04
This User Gave Thanks to gull04 For This Post:
# 5  
Old 02-24-2016
You don't even need the command substitution:
Code:
for i in t*
  do  a.out ${i}
  done

Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Execute sequential files and store data in single file

1)In a particualr path i have a set of inputfiles like path:/defaultmis/MonthlyLoads/INFA_EXPORT_022013/map* example: 1)map_de 2)map_cod 3)map_feg ........and so on in above path there wil be nearly 15 to 20 files starting with map and in other path i have another file input file... (4 Replies)
Discussion started by: katakamvivek
4 Replies

2. Programming

Run ruby test and include require

I want to run a test for the gem mini_magick: https://github.com/minimagick/minimagick I got the directory lib, inside of which i got: - mini_magick.rb - mini_gmagick.rb and inside of the test folder is the test i need to run: - image_test.rb and a helper file called: - test_helper.rb ... (1 Reply)
Discussion started by: tornow
1 Replies

3. Shell Programming and Scripting

Rename files in sub directories with sequential numbers

I can rename a file with sequential numbers from 1 to N with this script: num=1 for file in *.dat;do mv "$file" "$(printf "%u" $num).txt" let num=num+1 done The script begins with renaming a some.dat file to 1.dat.txt and goes on sequentially renaming other DAT files to... (1 Reply)
Discussion started by: shoaibjameel123
1 Replies

4. Programming

Tool to simulate non-sequential disk I/O (simulate db file sequential read) in C POSIX

Writing a Tool to simulate non-sequential disk I/O (simulate db file sequential read) in C POSIX I have over the years come across the same issue a couple of times, and it normally is that the read speed on SAN is absolutely atrocious when doing non-sequential I/O to the disks. Problem being of... (7 Replies)
Discussion started by: vrghost
7 Replies

5. Shell Programming and Scripting

sequential to line sequential

Hi I have a file sequential way i.e. written in contineous mode and the Record Seperator is AM from which the record is seperated .Now to process I have to make line sequential,and more over record length is not same it varies as per the input address, AM1234563 John Murray 24 Old streeet old... (5 Replies)
Discussion started by: vakharia Mahesh
5 Replies

6. UNIX for Dummies Questions & Answers

merging of files ! not in sequential in paralel

Hi , I am having 3 files as FILE1 1 2 3 FILE2 4 5 6 FILE3 7 8 9 I want to merge thes file such that the resultnt file should be as (1 Reply)
Discussion started by: arunkumar_mca
1 Replies

7. UNIX for Advanced & Expert Users

listing sequential files as one group...

Hi, I posted this over at Macnn and was redirected here... I'm not a unix programmer at all, but I have some backup if needed. Thanks in advance for any input. Is there a command for the osX terminal that will list sequentially numbered groups of file as one line instead of individually,... (1 Reply)
Discussion started by: kentm
1 Replies

8. Programming

Reading special characters while converting sequential file to line sequential

We have to convert a sequential file to a 80 char line sequential file (HP UX platform).The sequential file contains special characters. which after conversion of the file to line sequential are getting coverted into "new line" or "tab" and file is getting distorted. Is there any way to read these... (2 Replies)
Discussion started by: Rajeshsu
2 Replies

9. Programming

indexed sequential access in c files

hi, I want to implement indexed sequential access method in my flat file, Any idea other than INFORMIX C-ISAM library, because it is not free ware, Any Freeware available? (0 Replies)
Discussion started by: vrkiruba
0 Replies
Login or Register to Ask a Question