HI I am using awk and substr function to list out the directory names in the present working directory .
I am using below code
ls -l | awk '{ if ((substr($1,1,1)) -eq d) {print $9 }}'
But the problem is i am getting all the files and directories listed where as the requirement i wrote is for only dircetories.
I even tried below
ls -l | awk '{ if ((substr($1,1,1)) -eq 'd' ) {print $9 }}'
any help pls?
regards,
p