I'm trying to get an if statement to read the top line of a text file (tmp.txt) which has 0 on the last line. the "then" commands basically go into a directory and run a series of commands for DNA sequence analysis before coming back up, removing the top line of tmp.txt and moving onto the next directory listed in tmp.txt. once it gets to the end of all the listed directories the final line will just be a "0" or perhaps "file-end". The issue is, it's just not working and I can't figure out why. I've swapped out the "then" and "else" commands to make testing a bit easier.
#!bin/bash/sh
value=`(sed -n 1p tmp.txt)`
if ($value -eq 0)
then
echo "I wish i could eat cheese again"
else
echo "theres still more barcodes left"
fi
Aucun commentaire:
Enregistrer un commentaire