linux - Obtaining file names from directory in Bash -


i trying create zsh script test project. teacher supplied input files , expected output files. need diff output files myexecutable expected output files.

question: $if contain string in following code or kind of bash reference file?

#!/bin/bash inputfiles=~/project/tests/input/* outputfiles=~/project/tests/output  if in $inputfiles ./myexecutable $if > $outputfiles/$if.out done 

note:

any tips in fulfilling objectives nice. new shell scripting , using following websites write script (since have focus on project development , not wasting time on stuff):

grammar bash language

begginer guide bash

as code is, $if contains full path of file string.

n.b: don't use for if in $inputfiles

use for if in ~/project/tests/input/* instead. otherwise code fail if path contains spaces or newlines.


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -