fattest 0 Newbie Poster

i am writing a small script and part of it requires comparing two version strings in the form

V[1-9].[0-9].[0-9].[0-9]

The script will perform some action if the two strings have different subversions (STRING1=V1.1.0.2 and STRING2=V2.1.0.4 for example). So far the script is

for i in {1..4} 
do
	if [ $STRING1[(ws:.:)$i] < $STRING2[(ws:.:)$i] ] 
	then
		echo foo
	fi
	;
done

When executing the code it returns

no such file or directory: V1

and so on for each part of the version string. When I use = instead of > or < the script will run, I would just have to change the contents of the if statement. How can I get it to work with < or >?

Thanks.

edit: just realized i needed [[ and ]] around if...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.