I have a program named threshold. I have a set of images in a directory named images.
|-- images
| -----img_1.jpg
| -----img_2.jpg
| -----img_3.jpg
| ------
| ------img_n.jpeg
|-- threshold.exe
|-- myscript
How to write a bash script, so that it accepts the directory name as the argument and pass each of the files in the directory individually as argument to program threshold.exe.
If I execute,
$./myscript images
The final execution should be like this.
./threshold.exe img_1.jpg
./threshold.exe img_2.jpg
....
....
./threshold.exe img_n.jpg
doit.bat "c:\folder path\to\wherever"will park the"c:\folder path\to\wherever"argument to variable %1. Therefore, you would then query the filelist of %1 and pass each file tothreshold @file. ForFiles / Batch parameters Have fun. Try it, post your code, and we'll help you get further. Though, are you in Windows?./threshold img_1.jpgwon't work, becausethresholdis in the parent directory, not the current directory. You want either./threshold images/img_1.jpgor some equivalent to../threshold img_1.jpg.