Skip to main content

Thread: Using "chmod" in a simple shell script


hello

i'm trying write shell script takes folder name argument, , deletes "x" permissions files inside thas folder , in each subfolder.

here tried:
#!/bin/bash
fname=$1
chmod -x -r $fname
the problem is, can't access folders after executing script. hoped apply changes on ordinary files inside folders, not on folders themselves.

how can it?
lot

i suggest recursively cd each folder apply chomd command.


Forum The Ubuntu Forum Community Ubuntu Specialised Support Development & Programming Programming Talk Using "chmod" in a simple shell script


Ubuntu

Comments