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. |
Gidday!
Firstly, there's a programming forum ... Secondly, what language are you using? :} Cheers, Tink |
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 |
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 |
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 |
damn, hoped no one would notice :rolleyes:
wont happen again. And thanks for all the help guys! |
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 :p)
Save the penguin :Pengy: |
All times are GMT -5. The time now is 03:19 PM. |