#1
  1. No Profile Picture
    Up To No Good!
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2001
    Posts
    78
    Rep Power
    14

    How do I do this in telnet?


    How would I CHMOD all files in a certain directory and all its subdirectories to 666, and all the folders to 777 without going thru each subfolder and CHMODing every file in telnet?
  2. #2
  3. yet another member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2001
    Posts
    262
    Rep Power
    14
    Hi!

    You would need a condition....

    test -d <filename>
    returns true if <filename> is a directory.
    Make a little script that checks with test whether something is a dir and in the else expression place your commands for handling other types of files (i.e. non-directories).

    See man test there are more parameters to it if you want do distinguish links, too, and other things..

    Greetings,

    Atrus.


    P.S.: A shellscript condition looks something like:

    if test -d ... ; then
    chmod ...
    else
    chmod ...
    fi

IMN logo majestic logo threadwatch logo seochat tools logo