• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 180
  • Last Modified:

Shell coding

Hi,

I'm trying to get a shell script to run. I think I've correctly defined both $database and $antibodydb, but I'm currently receiving the error output:

genomevsantibody.sh: line 4: syntax error near unexpected token `for'
genomevsantibody.sh: line 4: `for antibodydb in $(find ~/DatabaseTesting -name "                                                                                                                                                             *ABDatabase")'

any advice with this would be much appreciated. Thanks.
#!/bin/bash
for database in $(find ~/Genomes -name "*DATABASE")

for antibodydb in $(find ~/DatabaseTesting -name "*ABDatabase")

do
   echo "Processing $database"
   blastall -p blastp -m 8 -d $antibodydb -i $database >> GenomeBlastResults.txt

done

Open in new window

0
StephenMcGowan
Asked:
StephenMcGowan
  • 2
1 Solution
 
farzanjCommented:
First for neither has
do
Nor
done
0
 
farzanjCommented:
You should have
for ...
do
    code here
done
0
 
woolmilkporcCommented:
You missed to open and close the outer "for" loop.
See lines 3 and 8 below.

 
#!/bin/bash
for database in $(find ~/Genomes -name "*DATABASE")
 do
  for antibodydb in $(find ~/DatabaseTesting -name "*ABDatabase")
   do
    echo "Processing $database"
    blastall -p blastp -m 8 -d $antibodydb -i $database >> GenomeBlastResults.txt
   done
 done

Open in new window

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now