<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: change file mode in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/change-file-mode/m-p/3637697#M238656</link>
    <description>Hello there: A couple of things to think about. While it is true that you can use the recursive option in chmod (i.e. chmod -R) as pointed out before please keep in mind this:&lt;BR /&gt;a) All the files in the path you select will be changed, including any subdirectory that may be part of the given path. You may have to redo subdirectories to reflect the correct permissions for them.&lt;BR /&gt;b) Only root and the owner of the file can change the mode. Make sure your UID is the owner of the files. Alternatively you can login as root.&lt;BR /&gt;c) You may want to use the script below after you test it to help you with the task (no guaranties of any kind). Best of luck&lt;BR /&gt;SCRIPT ----------------------&lt;BR /&gt;#! /usr/bin/sh&lt;BR /&gt;ARGS=$#&lt;BR /&gt;ARG0=$0&lt;BR /&gt;ARG1=$1&lt;BR /&gt;ARG2=$2&lt;BR /&gt;ARG3=$3&lt;BR /&gt;&lt;BR /&gt;usg_msg()&lt;BR /&gt;{&lt;BR /&gt;echo "\n$1 \n&lt;BR /&gt;usage: $ARG0 arg1 arg2 arg3&lt;BR /&gt;        arg1 = directory_namename (relative or absolute)&lt;BR /&gt;        arg2 = new mode for the files in the directory&lt;BR /&gt;        arg3 = new mode for subdirectories &lt;BR /&gt;        (all arguments must must be entered)&lt;BR /&gt;"&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;tst_arg()&lt;BR /&gt;{&lt;BR /&gt;if [ $ARGS -ne 3 ]&lt;BR /&gt;then&lt;BR /&gt;        echo $#&lt;BR /&gt;        usg_msg "Invalid number of arguments"&lt;BR /&gt;        exit 1&lt;BR /&gt;fi&lt;BR /&gt;if [ -d $ARG1 ]&lt;BR /&gt;then&lt;BR /&gt;        DIRPATH=$ARG1&lt;BR /&gt;else&lt;BR /&gt;        usg_msg "Invalid directory path"&lt;BR /&gt;        exit 1&lt;BR /&gt;fi&lt;BR /&gt;if (echo $ARG2 | grep "[a-zA-Z]" &amp;gt; /dev/null)&lt;BR /&gt;then&lt;BR /&gt;        usg_msg "$ARG2 Invalid mode"&lt;BR /&gt;        exit 1&lt;BR /&gt;else&lt;BR /&gt;        FILEPERM=$ARG2  #set this variable to the mode for ordinary files&lt;BR /&gt;fi&lt;BR /&gt;if (echo $ARG3 | grep "[a-zA-Z]" &amp;gt; /dev/null)&lt;BR /&gt;then&lt;BR /&gt;        usg_msg "$ARG3 Invalid mode"&lt;BR /&gt;        exit 1&lt;BR /&gt;else&lt;BR /&gt;        DIRPERMS=$ARG3  #set this to the mode required for subdirectories&lt;BR /&gt;fi&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;tst_arg&lt;BR /&gt;echo $DIRPATH $FILEPERM $DIRPERMS&lt;BR /&gt;read nothing&lt;BR /&gt;for afile in $(find $DIRPATH)&lt;BR /&gt;do&lt;BR /&gt;        if test -d $afile&lt;BR /&gt;        then &lt;BR /&gt;                chmod $DIRPERMS $afile&lt;BR /&gt;        else&lt;BR /&gt;                chmod $FILEPERM $afile&lt;BR /&gt;        fi&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Thu, 29 Sep 2005 01:26:14 GMT</pubDate>
    <dc:creator>Roboz</dc:creator>
    <dc:date>2005-09-29T01:26:14Z</dc:date>
    <item>
      <title>change file mode</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/change-file-mode/m-p/3637693#M238652</link>
      <description>If I want to change all the file mode of a specific user under all directories ( eg. edp_user ) , what can I do ? thx</description>
      <pubDate>Wed, 28 Sep 2005 22:49:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/change-file-mode/m-p/3637693#M238652</guid>
      <dc:creator>addendum</dc:creator>
      <dc:date>2005-09-28T22:49:37Z</dc:date>
    </item>
    <item>
      <title>Re: change file mode</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/change-file-mode/m-p/3637694#M238653</link>
      <description>chmod -R &lt;PERMISSION&gt; will help. &lt;BR /&gt;&lt;BR /&gt;-Arun&lt;/PERMISSION&gt;</description>
      <pubDate>Wed, 28 Sep 2005 22:53:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/change-file-mode/m-p/3637694#M238653</guid>
      <dc:creator>Arunvijai_4</dc:creator>
      <dc:date>2005-09-28T22:53:45Z</dc:date>
    </item>
    <item>
      <title>Re: change file mode</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/change-file-mode/m-p/3637695#M238654</link>
      <description>find /dir -type f -user edp_user -exec chmod "perms" {} \;&lt;BR /&gt;&lt;BR /&gt;find /dir -type d -user edp_user -exec chmod "perms" {} \;&lt;BR /&gt;&lt;BR /&gt;Anil</description>
      <pubDate>Wed, 28 Sep 2005 23:01:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/change-file-mode/m-p/3637695#M238654</guid>
      <dc:creator>RAC_1</dc:creator>
      <dc:date>2005-09-28T23:01:43Z</dc:date>
    </item>
    <item>
      <title>Re: change file mode</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/change-file-mode/m-p/3637696#M238655</link>
      <description>It is OK , thx</description>
      <pubDate>Wed, 28 Sep 2005 23:11:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/change-file-mode/m-p/3637696#M238655</guid>
      <dc:creator>addendum</dc:creator>
      <dc:date>2005-09-28T23:11:32Z</dc:date>
    </item>
    <item>
      <title>Re: change file mode</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/change-file-mode/m-p/3637697#M238656</link>
      <description>Hello there: A couple of things to think about. While it is true that you can use the recursive option in chmod (i.e. chmod -R) as pointed out before please keep in mind this:&lt;BR /&gt;a) All the files in the path you select will be changed, including any subdirectory that may be part of the given path. You may have to redo subdirectories to reflect the correct permissions for them.&lt;BR /&gt;b) Only root and the owner of the file can change the mode. Make sure your UID is the owner of the files. Alternatively you can login as root.&lt;BR /&gt;c) You may want to use the script below after you test it to help you with the task (no guaranties of any kind). Best of luck&lt;BR /&gt;SCRIPT ----------------------&lt;BR /&gt;#! /usr/bin/sh&lt;BR /&gt;ARGS=$#&lt;BR /&gt;ARG0=$0&lt;BR /&gt;ARG1=$1&lt;BR /&gt;ARG2=$2&lt;BR /&gt;ARG3=$3&lt;BR /&gt;&lt;BR /&gt;usg_msg()&lt;BR /&gt;{&lt;BR /&gt;echo "\n$1 \n&lt;BR /&gt;usage: $ARG0 arg1 arg2 arg3&lt;BR /&gt;        arg1 = directory_namename (relative or absolute)&lt;BR /&gt;        arg2 = new mode for the files in the directory&lt;BR /&gt;        arg3 = new mode for subdirectories &lt;BR /&gt;        (all arguments must must be entered)&lt;BR /&gt;"&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;tst_arg()&lt;BR /&gt;{&lt;BR /&gt;if [ $ARGS -ne 3 ]&lt;BR /&gt;then&lt;BR /&gt;        echo $#&lt;BR /&gt;        usg_msg "Invalid number of arguments"&lt;BR /&gt;        exit 1&lt;BR /&gt;fi&lt;BR /&gt;if [ -d $ARG1 ]&lt;BR /&gt;then&lt;BR /&gt;        DIRPATH=$ARG1&lt;BR /&gt;else&lt;BR /&gt;        usg_msg "Invalid directory path"&lt;BR /&gt;        exit 1&lt;BR /&gt;fi&lt;BR /&gt;if (echo $ARG2 | grep "[a-zA-Z]" &amp;gt; /dev/null)&lt;BR /&gt;then&lt;BR /&gt;        usg_msg "$ARG2 Invalid mode"&lt;BR /&gt;        exit 1&lt;BR /&gt;else&lt;BR /&gt;        FILEPERM=$ARG2  #set this variable to the mode for ordinary files&lt;BR /&gt;fi&lt;BR /&gt;if (echo $ARG3 | grep "[a-zA-Z]" &amp;gt; /dev/null)&lt;BR /&gt;then&lt;BR /&gt;        usg_msg "$ARG3 Invalid mode"&lt;BR /&gt;        exit 1&lt;BR /&gt;else&lt;BR /&gt;        DIRPERMS=$ARG3  #set this to the mode required for subdirectories&lt;BR /&gt;fi&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;tst_arg&lt;BR /&gt;echo $DIRPATH $FILEPERM $DIRPERMS&lt;BR /&gt;read nothing&lt;BR /&gt;for afile in $(find $DIRPATH)&lt;BR /&gt;do&lt;BR /&gt;        if test -d $afile&lt;BR /&gt;        then &lt;BR /&gt;                chmod $DIRPERMS $afile&lt;BR /&gt;        else&lt;BR /&gt;                chmod $FILEPERM $afile&lt;BR /&gt;        fi&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 29 Sep 2005 01:26:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/change-file-mode/m-p/3637697#M238656</guid>
      <dc:creator>Roboz</dc:creator>
      <dc:date>2005-09-29T01:26:14Z</dc:date>
    </item>
  </channel>
</rss>

