suppress some grep outputs

Hello Friends,

Im working on Ksh (it is not my will :slight_smile: )
I would like to get rid off the outputs lines which includes "can't open" .. i guess it must be an easy thing but could not find any usefull thing,

ls -l *credit* | xargs grep -i "*data*"
22:set conv(DATA)    B16
22:proc insert_task_msisdn {msisdn command {adc_data ""}}
grep: can't open -rwxr-xr-x
grep: can't open sas
grep: can't open sas
grep: can't open 763
Output:

22:set conv(DATA)    B16
22:proc insert_task_msisdn {msisdn command {adc_data ""}}

Best Regards,

have you looked into the 2> option? this redirects errors.

ls | grep .txt 2>/dev/null

How about:

ls -l *credit* | xargs grep -i "*data*" | grep -v "can't open"

Thanks Joeyg, redirecting error output didnt come into my mind