Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #238246

Re: Bash script problem

From <tomas@tuxteam.de>
Newsgroups linux.debian.user
Subject Re: Bash script problem
Date 2021-08-06 09:00 +0200
Message-ID <CJ1ZM-4XP-5@gated-at.bofh.it> (permalink)
References (4 earlier) <CIKcx-2Ph-9@gated-at.bofh.it> <CIRQJ-7vr-1@gated-at.bofh.it> <CIV7X-QV-1@gated-at.bofh.it> <CIVAZ-1fl-3@gated-at.bofh.it> <CIWnn-1ul-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

On Fri, Aug 06, 2021 at 10:52:51AM +1000, David wrote:

[...]

> I was commenting on how I have always been puzzled why
> someone made the effort to give 'chmod' an '-R' option, but
> never made it actually useful for common cases. As it is,
> it seems that it's really only useful for modifying the write attribute.

It doesn't cover all the cases, but you're aware of the 'X' variant
for chmod (aka: turn on the x bit if a directory, but also if it
has already an x bit somewhere else, alas):

  tomas@trotzki:~$ ls -ald f*b
  -rw-r--r-- 1 tomas tomas    0 Aug  6 08:49 fib
  drwxr-xr-x 2 tomas tomas 4096 Aug  6 08:48 fob
  -rwxr--r-- 1 tomas tomas    0 Aug  6 08:48 fub

  tomas@trotzki:~$ chmod go+X f?b

  tomas@trotzki:~$ ls -ald f*b
  -rw-r--r-- 1 tomas tomas    0 Aug  6 08:49 fib
  drwxr-xr-x 2 tomas tomas 4096 Aug  6 08:48 fob
  -rwxr-xr-x 1 tomas tomas    0 Aug  6 08:48 fub

It might /sometimes/ do what you want (i.e. in the most common case
where you want dirs to have the x bit set, but regular files not).

Cheers
 - t

Back to linux.debian.user | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Bash script problem "Gary L. Roach" <garyroach719@gmail.com> - 2021-08-05 02:00 +0200
  Re: Bash script problem Greg Wooledge <greg@wooledge.org> - 2021-08-05 02:10 +0200
    Re: Bash script problem "Gary L. Roach" <garyroach719@gmail.com> - 2021-08-05 05:50 +0200
      Re: Bash script problem john doe <johndoe65534@mail.com> - 2021-08-05 09:00 +0200
      Re: Bash script problem <tomas@tuxteam.de> - 2021-08-05 10:10 +0200
        Re: Bash script problem Greg Wooledge <greg@wooledge.org> - 2021-08-05 13:20 +0200
          test vs. [ [was: Bash script problem] <tomas@tuxteam.de> - 2021-08-05 14:00 +0200
            Re: test vs. [ [was: Bash script problem] Greg Wooledge <greg@wooledge.org> - 2021-08-05 14:40 +0200
              Re: test vs. [ [was: Bash script problem] <tomas@tuxteam.de> - 2021-08-05 15:00 +0200
      Re: Bash script problem Greg Wooledge <greg@wooledge.org> - 2021-08-05 14:30 +0200
  Re: Bash script problem Anssi Saari <as@sci.fi> - 2021-08-05 09:40 +0200
    Re: Bash script problem Tixy <tixy@yxit.co.uk> - 2021-08-05 10:30 +0200
      Re: Bash script problem <tomas@tuxteam.de> - 2021-08-05 10:40 +0200
        Re: Bash script problem Greg Wooledge <greg@wooledge.org> - 2021-08-05 14:00 +0200
          Re: Bash script problem "Gary L. Roach" <garyroach719@gmail.com> - 2021-08-05 22:10 +0200
            Re: Bash script problem Greg Wooledge <greg@wooledge.org> - 2021-08-05 22:20 +0200
              Re: Bash script problem "Gary L. Roach" <garyroach719@gmail.com> - 2021-08-06 17:00 +0200
                Re: Bash script problem <tomas@tuxteam.de> - 2021-08-06 17:10 +0200
            Re: Bash script problem David <bouncingcats@gmail.com> - 2021-08-06 01:40 +0200
              Re: Bash script problem Greg Wooledge <greg@wooledge.org> - 2021-08-06 02:10 +0200
                Re: Bash script problem Polyna-Maude Racicot-Summerside <debian@polynamaude.com> - 2021-08-06 02:20 +0200
                Re: Bash script problem Greg Wooledge <greg@wooledge.org> - 2021-08-06 02:30 +0200
                Re: Bash script problem The Wanderer <wanderer@fastmail.fm> - 2021-08-06 03:50 +0200
                Re: Bash script problem Greg Wooledge <greg@wooledge.org> - 2021-08-06 04:10 +0200
              Re: Bash script problem Polyna-Maude Racicot-Summerside <debian@polynamaude.com> - 2021-08-06 02:10 +0200
                Re: Bash script problem Christian Groessler <chris@groessler.org> - 2021-08-06 02:30 +0200
                Re: Bash script problem Christian Groessler <chris@groessler.org> - 2021-08-06 03:00 +0200
                Re: Bash script problem Greg Wooledge <greg@wooledge.org> - 2021-08-06 03:10 +0200
                Re: Bash script problem David <bouncingcats@gmail.com> - 2021-08-06 03:10 +0200
                Re: Bash script problem David <bouncingcats@gmail.com> - 2021-08-06 03:00 +0200
                Re: Bash script problem <tomas@tuxteam.de> - 2021-08-06 09:00 +0200
              Re: Bash script problem David Wright <deblis@lionunicorn.co.uk> - 2021-08-06 05:10 +0200
                Re: Bash script problem David <bouncingcats@gmail.com> - 2021-08-06 05:50 +0200
              Re: Bash script problem Darac Marjal <mailinglist@darac.org.uk> - 2021-08-06 09:20 +0200
  Re: Bash script problem Tom Browder <tom.browder@gmail.com> - 2021-08-06 01:00 +0200

csiph-web