Unix Technical Forum

[OT - Probably] ls program query

This is a discussion on [OT - Probably] ls program query within the Slackware Linux Support forums, part of the Unix Operating Systems category; --> Some years back, someone, somewhere, tinkered with the standard ls program so that when files and directories were displayed, ...


Go Back   Unix Technical Forum > Unix Operating Systems > Slackware Linux Support

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-20-2008, 02:36 PM
No_One
 
Posts: n/a
Default [OT - Probably] ls program query

Some years back, someone, somewhere, tinkered with the standard ls program
so that when files and directories were displayed, the permissions where
listed in the numeric format instead of the usual rwx format.

I used to have the source, don't now.

Has anyone come across this altered version.

ken
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-20-2008, 02:36 PM
William Hunt
 
Posts: n/a
Default Re: [OT - Probably] ls program query

On Tue, 14 Feb 2006, No_One wrote:

> Some years back, someone, somewhere, tinkered with the standard ls program
> so that when files and directories were displayed, the permissions where
> listed in the numeric format instead of the usual rwx format.

[...]

roll yer own.
for example, stuff the following into a file (say, 'foo'):

#!/bin/awk -f
{
gsub( "rwx","7", $1 )
gsub( "rw-","6", $1 )
gsub( "r-x","5", $1 )
gsub( "r--","4", $1 )
gsub( "-wx","3", $1 )
gsub( "-w-","2", $1 )
gsub( "--x","1", $1 )
gsub( "---","0", $1 )
print
}
# the end.

then,
chmod +x foo
ls -l | foo


okay, okay, yes, sleazy, doesn't do stickybits, yada yada yada.


--
William Hunt, Portland Oregon USA
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-20-2008, 02:36 PM
Thomas Overgaard
 
Posts: n/a
Default Re: [OT - Probably] ls program query


No One wrote :

> Has anyone come across this altered version.


Is it this patch your searching for?
<URL: http://www.mail-archive.com/bug-fileutils@gnu.org/msg01882.html>

OK. it seems to be a bit old as its for version 4.1 and Slackware comes
with version 5.2.1. But it ought to be possible to make a updated
version of the patch.
--
Thomas O.

This area is designed to become quite warm during normal operation.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-20-2008, 02:37 PM
No_One
 
Posts: n/a
Default Re: [OT - Probably] ls program query

On 2006-02-14, Thomas Overgaard <thover@post2.tele.dk> wrote:
>
> No One wrote :
>
>> Has anyone come across this altered version.

>
> Is it this patch your searching for?
><URL: http://www.mail-archive.com/bug-fileutils@gnu.org/msg01882.html>


Damn, that's it!!! Same individual! I could never remember his name.

>
> OK. it seems to be a bit old as its for version 4.1 and Slackware comes
> with version 5.2.1. But it ought to be possible to make a updated
> version of the patch.


Yeah, I'm going to take a look at it first chance, probably over the weekend.

Thanks...

ken
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 02-20-2008, 02:37 PM
No_One
 
Posts: n/a
Default Re: [OT - Probably] ls program query

On 2006-02-14, William Hunt <wjh@prv8.net> wrote:
>
>
> okay, okay, yes, sleazy, doesn't do stickybits, yada yada yada.


Life isn't perfect, however, the script works fine.

Nice work and thanks for the info.

ken
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 02-20-2008, 02:38 PM
No_One
 
Posts: n/a
Default Re: [OT - Probably] ls program query -- follow up

Just as a curiosity issue...

I downloaded the patch specified, downloaded version fileutils 4.x from
gnu.org applied the patch ( which failed on some minor issues related to man
pages ) and compiled. renamed the newly compiled version to loc and copied
to /usr/bin

running loc -O produces the following output:

755 drwxr-xr-x 3 root root 496 Jan 25 05:35 .
755 drwxr-xr-x 12 root root 2440 Feb 12 04:40 ..
755 -rwxr-xr-x 1 root root 669 Sep 16 2003 setup.05....
755 -rwxr-xr-x 1 root root 170 Feb 15 2003 setup.70....
644 -rw-r--r-- 1 root root 3331 Jul 8 1994 text.lil....
700 drwx------ 2 root root 48 Feb 13 16:29 tmp

I thought it curious that gnu didn't adopt the -O switch, oh, well.

ken


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 09:16 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com