Help regarding shell script

So ls -n looks like this?

-rwxrwxr-x 1 74861 1750560623          10 Jan 27 12:21 list.sh
-rwxr-x--- 1 74861 1750560623          80 Jan 28 09:25 .desk

And lsuser -ca id ALL | grep 74861 gives:

  mike001: 74861

If so, it could be the space in front of the userid. How about this:

ls -n $@ | awk -F: '
function max(a,b) {return a>b?a:b}
function toend(str,fld)
{ for(i=0; i<length(str); i++) {
    while(substr(str,i,1) != " " && i<length(str)) i++
    while(substr(str,i,1) == " " && i<length(str)) i++
    if (!--fld) return substr(str,i)
  }
  return ""
}
BEGIN {
    while("lsuser -c -a id ALL"  | getline) {
        gsub(" ","")
        U[$2]=$1; UW=max(UW,length($1))}
    while("lsgroup -c -a id ALL" | getline) {
        G[$2]=$1; GW=max(GW,length($1))}
}
{
    printf "%10s %3s %-*s %-*s %11s %s\n", $1, $2,
      UW, $3 in U?U[$3]:$3,
      GW, $4 in G?G[$4]:$4,
      $5, toend($0,5)
}' FS=" "

S,

I get the output as in post 39 but with the UID off from the output;

-rwxrwxr-x1 Func-Wireless-consumers  10 Jan 27 12:21 list.sh
-rwxr-x---    1 Func-Wireless-consumers  80 Jan 28 09:25 .desk

The problem here is in both of the previous codes the UID is not displaying my name MIKE045

I think from your previous posts the UID for MIKE045 is 1750560623 correct?

If you do

$ lsuser -ca id ALL | grep -i mike

Do you see an entry like:

MIKE045:1750560623

H Chubler.

The one you mentioned is right. But when I put on the code I dont see any output though.

From your previous codes, group names full length is retrieved the only problem is with the UID which is not retrieving as UID name , getting it as numeric