comparing special characters in KSH

Hi Guys,

I came across a scenario where I have to check the starting character of line in a file.
if it is a specile character i.e. "<" gretaer then perform action.
I tried serval ways but could not get the work done.

Please help me ....
Thanks

< is less-than. You mean >?

Which line? All of them, any of them, or a specific one?

All the lines starting with either greater than or lesser than symbol......"<" or ">".
where I should process line by line...

$ cat file1
< line 1
sdasd
asdadasd
> line 4
< line 5
---- > line 6

$ cat myScript
while read LINE; do
  if [[ $LINE =~ '^<' ]] || [[ $LINE =~ '^>' ]]; then
    echo $LINE
  fi
done < file1

$ ./myScript
< line 1
> line 4
< line 5

Hi Scott,

I tried with the code but it is throwing an error as below

test.ksh[2]: syntax error at line 3 : `=~' unexpected

I am using KSH ...please let me know any suggestions

---------- Post updated at 10:49 AM ---------- Previous update was at 10:45 AM ----------

My questions is I should have a condition in IF clause to compare special character like greater than and lesser than symbols which should be used for line by line processing in KSH

File

<line1
<line2
-----<line3
<line4
askjler
lkajwoie
>line5

output expected

<line1
<line2
<line4
>line5

while read line
do
   if [ `echo ${line} | egrep "^\<|^\>" | wc -l` -eq 0 ]
   then
         :
   else
         echo $line
   fi
done < file
while read line
do
 if [[ $line == @(<*|>*) ]]
 then
  echo $line
 fi
done < file