I'm trying to use a input variable $1 in a path
if [ -d "$1" ]; then
echo "The Directory Exists"
files=`find /cygdrive/c/2014-03-19 -name "*ellow.txt"`
for file in $files; do
etc...
Now instead of using the date, I'd like to use $1 (as the users inputted variable) for which directory they'd like to use. /cygdrive/c/$1. But I don't think this works inside back ticks. Any suggestions? I've tried assigning $1 a variable name but it's still the same issue of it taking it literally. How could I use a variable in this path?
Cheers lads.
while IFS='' read -r -d '' file; do ...; done < <(find ... -print0)"/cygdrive/c/$1", with the double quotes. Otherwise, the name can be split into multiplefindarguments rather than passed as a single one.