LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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, 03: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, 04:14 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,066
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Gidday!

Firstly, there's a programming forum ...

Secondly, what language are you using? :}

Cheers,
Tink
 
Old 12-01-2002, 04: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, 07:18 PM   #4
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,066
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
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, 07:21 PM   #5
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974
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, 01: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, 02: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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 09:19 PM
Question about programming jcramer Mandriva 2 02-01-2004 03:22 PM
C Programming Question Makaveli.2003 Programming 4 03-03-2003 07:34 AM
Programming question LinuxQuest01 Linux - Software 3 08-09-2002 12:42 PM
newbie programming question aizkorri Programming 4 03-22-2002 04:39 PM


All times are GMT -5. The time now is 10:43 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration