I am a dba turned automation script writer and am writing my first korn shell script.
Scenario: reading multiple lined message file and if I find the line with the version in it, I need to compare to a version file with one line in it with correct version number. The 2 lines are formatted the same.
What I tried:
cat /home/userfolder/testing/Tar/Messagefile.dat | while read LINE
#if [[ "$LINE" = "$Version.txt" ]]
if [[ "$LINE" = ' * Software name Version n.n.nnn' ]]
1) assigned file name to variable and compare the value. Couldn't find the file.
2) Put in the name of the file to compare to (I think this bombed due to not 'READ'ing the Version.txt file.
3) put the literal in the comparison.
Result: None worked.
1. How do I correctly assign a file to a variable.
2. Is there an issue since there is a * in the line?