View Single Post
Old 27 May 2020, 12:13   #1
mc68060
With MMU and FPU!
 
Join Date: Mar 2015
Location: On your mainboard
Posts: 270
Read file and compare it to a string

I want to compare the contents of a file against a string in an AmigaDOS script. Let's say I want to check if the file ram:test contains the string "Hello World". I've tried to do it like this but it doesn't work:

Code:
echo >ram:test "Hello World"
set foo <ram:test
if $foo eq "Hello World"
  echo "Yep!"
else
  echo "Nope!"
endif
This prints "Nope!" although I'd expect it to print "Yep!" but I don't understand why it doesn't work...
mc68060 is offline  
 
Page generated in 0.04274 seconds with 11 queries