![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
ls AND cut
Hi,
this is a small script, it should print on the screen only the 3rd colum of ls -laR, so where there are the user's permissions, but, if the script is: permission=rw-r--r-- ls -laR | grep "^-$permission" | cut -d' ' -f3 IT DOESN'T WORK, it print in some rows the username, in others the numer 1: example: username username username 1 1 1 username 1 If I remove the -a opzion IT WORKS: permission=rw-r--r-- ls -lR | grep "^-$permission" | cut -d' ' -f3 IT print: username username username username Why? |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|