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):
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
Post a Comment