mercredi 29 avril 2015

Bash Scripting - Obtaining file names from directory

I am trying to create a zsh script to test my project. The teacher supplied us with some input files and expected output files. I need to diff the output files from myExecutable with the expected output files.

Question: Does $iF contain a string in the following code or some kind of bash reference to the file?

#!/bin/bash
inputFiles=~/project/tests/input/*
outputFiles=~/project/tests/output

for iF in $inputFiles
./myExecutable $iF > $outputFiles/$iF.out
done

Note:

Any tips in fulfilling my objectives would be nice. I am new to shell scripting and I am using the following websites to quickly write the script (since I have to focus on the project development and not wasting time on extra stuff):

Grammar for bash language

Begginer guide for bash

Aucun commentaire:

Enregistrer un commentaire