1

I have an executable to treat photographs call GFA-LIN. You can run the executable normally like:

$./GFA-LIN

**********************************************************************
***                                                                ***
***         G A P    F R A C T I O N    A N A L Y S I S            ***
***                                                                ***
**********************************************************************
 --- GNU Copyright (C) 1982-2014 by Jean-Michel Walter. Contributors: Alemu Gonsamo. --- 

Enter the name of the *.bmp file: 

Now, you have to enter the name of your .bmp file. Let's say I have two files DHP01.bmp and DHP02.bmp.

1) I want to input automatically, via loop in shell, something like:

for i in *.bmp; do

echo $i | GFA-LIN

done

However, the problem appears when the executable continues:

Loading BMP: DSCN0001(test).bmp

Geometric distortion of the fish-eye lens: 
1: Equidistant (or polar)
2: Orthographic
?  

2) All the other inputs of my executable are not files, but single numbers, like:

Geometric distortion of the fish-eye lens: 1: Equidistant (or polar) 2: Orthographic ? {1}

BMP: DSCN0001(test).bmp Loaded

To extract the image from the background
Enter the coordinates of 3 points on the horizon circle of the image:
Point 1 (X integer  Y integer): {806 705}
Point 2 (X integer  Y integer): {1507 325}
Point 3 (X integer  Y integer): {428 456}
Center: 932 , 101
Radius: 616.475

Is the working image classified or grey-toned (c/g) ? {c}

3) Etc... Like a mix between files, numbers and characters.

How can I proceed in this case? I've tried something like

#!/bin/bash
for i in *.bmp; do
echo "$i 
1
806 133
700 1507
1941 714
c
y
0.0
90.0 
9.0"  | GFA-LIN

done

It doesn't work =(

Sorry if this question was replied before, or if it is super stupid. I am new in shell.

Thanks a lot!

  • Guys, just figured out how to do it. '#!/bin/bash'` for i in *.bmp; do echo "$i 1 806 133 700 1507 1941 714 c y 0.0 90.0 9" | GFALIN echo "$i 1 806 133 700 1507 1941 714 c n 9 10 0.0" | GFALIN mv gapfract.txt gapfract_$i.txt mv gapsize.txt gapsize_$i.txt done` – Renato Braghiere Oct 08 '15 at 18:57

0 Answers0