Recent: Fix food processor motor?

Mend Operating Systems

Mend Software, Operating Systems
Find out how to mend it for free.

Ask Question
Mend Software, Operating Systems
Mend repair fix operating systems

Mend > Operating Systems

Mend Software, Operating Systems

how to write a unix shell script?

I need to find in the /usr/bin all the files that has any charater as its fourth carater except a lowercase x or -. How do you write a shell script using the KornShell to do that using grep. example -r-xr-xr-x or drwxr-xr-x. I have tried this but it does not work.

ls -l /usr/bin|grep '^...[^x-]......$'|sort -r|uniq|wc -l

what am I doing wrong?

Steve
August 2005
I beleive that I have a solution to the problem.

#!/bin/ksh
#Output all the files using ls -l /usr/bin and grep that has any #fourth charater except a lowercase x or -. Example -r-xr-xr-x #or drwxr-xr-x.
#sample use: nodashx

ls -l /usr/bin|tail +2|grep '^...[^x-]......'|sort -r|wc -l

exit

#I have tested this solution and it worked.

Steve
August 2005
Mend Software, Operating Systems
Mend repair fix operating systems

How to mend ...

Find out how to mend just about anything howtomendit.com for free repair help, information and advice.
Mend Software, Operating Systems
Mend repair fix operating systems