superstarjpmc
Programmer
hi,
i have a requirement where inside an awk script i need to execute a unix 'ls -l' to pick the file/directory permission, user name, group name,filename,date,etc.
When i use a cut, i'm afraid that it might not provide me the right results as i use the delimiter .. -d' '.. this will obviously fetch a wrong result depending on the file created time,size etc.. which alters the white spaces..
Guess i have explained my requirement properly !..
what i have done ..
.........
.........
x4 contains the output of 'ls -ld <file/dir name>'
x5[0]= x4 " | cut -f1 -d \" \" ";
x5[1]= x4 " | cut -f5 -d \" \" ";
x5[0] | getline o5[0];
x5[1] | getline o5[1];
print o5[0];
print o5[1];
.........
.........
i thought of using 'awk' instead of 'cut'..but i dont know how to use an awk inside an awk script ..
any help much appreciated.
i have a requirement where inside an awk script i need to execute a unix 'ls -l' to pick the file/directory permission, user name, group name,filename,date,etc.
When i use a cut, i'm afraid that it might not provide me the right results as i use the delimiter .. -d' '.. this will obviously fetch a wrong result depending on the file created time,size etc.. which alters the white spaces..
Guess i have explained my requirement properly !..
what i have done ..
.........
.........
x4 contains the output of 'ls -ld <file/dir name>'
x5[0]= x4 " | cut -f1 -d \" \" ";
x5[1]= x4 " | cut -f5 -d \" \" ";
x5[0] | getline o5[0];
x5[1] | getline o5[1];
print o5[0];
print o5[1];
.........
.........
i thought of using 'awk' instead of 'cut'..but i dont know how to use an awk inside an awk script ..
any help much appreciated.