Matching patterns

I have a file name in $f. If $f has "-" at the beginning, or "=", or does not have extension ".ry" or ".xt" or ".dat" then cerr would not be empty.

Tried the following but having some problems.

set cerr = `echo $f | awk '/^-|=|!.ry|!.xt|!.dat/'`

You may need to enclose inside brackets.

awk `/^(-|=)/ && $0 !~ /(.ry|.xt|.dat)/`
echo "hello=sdsd.ry" | awk '/(^-|=)/ && $0 !~ /(.ry|.xt|.dat)/'

gives nothing

if there is an = or starts with -, I want it to output the string

awk '(/^-/||/=/)&&!/(\.ry|\.xt|\.dat)/' 

I think it should be

awk '/(^-|=)/ || ! /(.ry|.xt|.dat)/'`

---------- Post updated at 01:34 AM ---------- Previous update was at 01:31 AM ----------

We're getting there.

Yes I needed a "\" before the "." :b:

---------- Post updated at 01:43 AM ---------- Previous update was at 01:34 AM ----------

Using "hellodfdfxt" gave me no result. There is no ".xt" in it, but just has "xt" in it, so should have printed the string.

 echo hellodfdfxt | awk '/(^-|=)/ && ! /(\.ry|\.xt|\.dat)/'