Attempting to locate all lines in a list of files containing jane, then test if the result exists as a real file, and append their names to a Document. Here is my code:
#!/bin/bash
> oldFiles.txt
janeSearch=$( grep " jane " ../data/list.txt | cut -d ' ' -f 1,3 )
for x in $janeSearch;
if test -e ~/$x: then
echo $x >> oldFiles.txt
fi
Can someone explain why I get the following error?
syntax error near unexpected token `if'
dobefore theif.doneafter thefito pair with the missingdo.