• Post Reply Bookmark Topic Watch Topic
  • New Topic

I want to have the user and the others the same rights  RSS feed

 
ekte spiriopoulos
Ranch Hand
Posts: 217
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is a text:
-rwxr-xrwx 2 hex nt 0 Jun 3 19:00 file1
--wx--x-wx 2 hex nt 0 Jun 3 19:00 file2
------x--- 2 hex nt 0 Jun 3 19:00 file3
-rw-r---w- 2 hex nt 0 Jun 3 19:00 file4
-r-xr-x--x 2 hex nt 0 Jun 3 19:00 file5
---x-wx-wx 2 hex nt 0 Jun 3 19:00 file6
---x--x--x 2 hex nt 0 Jun 3 19:00 file7

i should appear with regular expression the lines that user and others have the same rights.
I tried using $chmod u=o but nothing..
 
Stephan van Hulst
Saloon Keeper
Posts: 7992
143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you just wildly guessing? Do you know how regular expressions work?
 
Henry Wong
author
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

additionally ... the "chmod" command doesn't support regular expressions (unless something changed drastically recently ... ).

Henry
 
Campbell Ritchie
Marshal
Posts: 56576
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
chmod 660 *
???

But that might be a bit too permissive a policy. Make sure to add the users to your group so they can have access.
 
Stephan van Hulst
Saloon Keeper
Posts: 7992
143
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It appears Ekte is working with some text file, and not the actual files.
 
ekte spiriopoulos
Ranch Hand
Posts: 217
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Stephan van Hulst wrote:It appears Ekte is working with some text file, and not the actual files.
the text is output fom ls-l .What i supposed to do is to give regular expression so that i will appear the lines that have user and others the same rights, but i think i gave it right :/
 
Henry Wong
author
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ekte spiriopoulos wrote:
Stephan van Hulst wrote:It appears Ekte is working with some text file, and not the actual files.
the text is output fom ls-l .What i supposed to do is to give regular expression so that i will appear the lines that have user and others the same rights, but i think i gave it right :/


... then, "chmod" is definitely *not* the right command to use, as it doesn't do any stream (or any type of data) manipulation. To changes those lines, you can use any of the many tools available with unix/linux, such as "awk", "perl", "tcl", etc. etc. etc.

Henry
 
Stephan van Hulst
Saloon Keeper
Posts: 7992
143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you know what a regular expression is, and what it does? I recommend reading more about them here: http://www.regular-expressions.info/tutorialcnt.html
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!