LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-01-2002, 02:49 PM   #1
pk21
Member
 
Registered: Jun 2002
Location: Netherlands - Amsterdam
Distribution: RedHat 9
Posts: 549

Rep: Reputation: 30
Question Programming question


Can anyone tell me how i can get the string -rw-r--r-- to be seperated in -, rw-, r-- and r--?

I think i have to use sed but am not sure

Help would be appreciated.
 
Old 12-01-2002, 03:14 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Gidday!

Firstly, there's a programming forum ...

Secondly, what language are you using? :}

Cheers,
Tink
 
Old 12-01-2002, 03:17 PM   #3
pk21
Member
 
Registered: Jun 2002
Location: Netherlands - Amsterdam
Distribution: RedHat 9
Posts: 549

Original Poster
Rep: Reputation: 30
i know there is a programming forum, but i thought that this would be a very newbie question so thats why i am posting here.

And im using bash
 
Old 12-01-2002, 06:18 PM   #4
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Hello again ...

I wouldn't know of any stringhandling commands
built into bash, but you could filter the output of
your ls through the colrm-command, or sed
(or use Perl instead of bash-scripting ;})

for instance like that ...
ls -l | colrm 11 | colrm 1 7 will give you the perms for o
ls -l | colrm 8 | colrm 1 4 will give you the perms for g
ls -l | colrm 5 | colrm 1 1 will give you the perms for u
ls -l | colrm 2 will give you directory flag

HIH

Cheers,
Tink
 
Old 12-01-2002, 06:21 PM   #5
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
pk21 you have had over two hundred posts... you know fully well that you shouldn't double post. wether your original one is in the wrong forum or not is irrelevant...

http://www.linuxquestions.org/questi...threadid=36990
 
Old 12-02-2002, 12:05 PM   #6
pk21
Member
 
Registered: Jun 2002
Location: Netherlands - Amsterdam
Distribution: RedHat 9
Posts: 549

Original Poster
Rep: Reputation: 30
damn, hoped no one would notice

wont happen again.

And thanks for all the help guys!
 
Old 12-02-2002, 01:17 PM   #7
Ciccio
Member
 
Registered: Nov 2002
Location: Paraguay
Distribution: Mandrake 10
Posts: 573

Rep: Reputation: 30
I think that the thread can be moved from a one forum to another... Anyway, what comes to bash programming I'm still a newbie... (newbier than you apparently )

Save the penguin
 
  


Reply



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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
a little programming question haora Programming 3 06-24-2005 08:19 PM
Question about programming jcramer Mandriva 2 02-01-2004 02:22 PM
C Programming Question Makaveli.2003 Programming 4 03-03-2003 06:34 AM
Programming question LinuxQuest01 Linux - Software 3 08-09-2002 11:42 AM
newbie programming question aizkorri Programming 4 03-22-2002 03:39 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:32 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration