<?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: Script addition in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/script-addition/m-p/5159222#M684347</link>
    <description>James, as usual, your knowledge is extremely beneficial! DOn't ever leave the forums! Thanks Again James!</description>
    <pubDate>Wed, 25 Feb 2009 13:54:39 GMT</pubDate>
    <dc:creator>Adam W.</dc:creator>
    <dc:date>2009-02-25T13:54:39Z</dc:date>
    <item>
      <title>Script addition</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-addition/m-p/5159209#M684334</link>
      <description>Guru's I have attached a script a few of you came up with. I have a question though, How would I add a "test" to this? I think I have the correct syntax down, it is &lt;BR /&gt;&lt;BR /&gt;If [[ $# != 1 ]]&lt;BR /&gt;then&lt;BR /&gt;  echo â  Test mode - Command would be:  chown / chmodâ   $FILENAME  &lt;BR /&gt;else&lt;BR /&gt;  perform chown/chmod&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;But I am having trouble incorporating it into the script. Can someone help me with where to add this in, or know of an easier way?</description>
      <pubDate>Tue, 24 Feb 2009 19:19:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-addition/m-p/5159209#M684334</guid>
      <dc:creator>Adam W.</dc:creator>
      <dc:date>2009-02-24T19:19:32Z</dc:date>
    </item>
    <item>
      <title>Re: Script addition</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-addition/m-p/5159210#M684335</link>
      <description>&lt;!--!*#--&gt;Hi Adam:&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;if [ $# -ne 1 ]; then&lt;BR /&gt;    echo "ONE argument only, please"&lt;BR /&gt;else&lt;BR /&gt;    echo "OK, I saw one argument"&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;...&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Tue, 24 Feb 2009 19:29:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-addition/m-p/5159210#M684335</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-02-24T19:29:53Z</dc:date>
    </item>
    <item>
      <title>Re: Script addition</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-addition/m-p/5159211#M684336</link>
      <description>JRF, I'd take it one step further:&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;if [ $# -ne 1 ]; then&lt;BR /&gt;    echo "ONE argument only, please"&lt;BR /&gt;    exit 99&lt;BR /&gt;else&lt;BR /&gt;    echo "OK, I saw one argument"&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;...&lt;BR /&gt;&lt;BR /&gt;If not using one and only one argument, get the heck out of Dodge.  :-)</description>
      <pubDate>Tue, 24 Feb 2009 19:33:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-addition/m-p/5159211#M684336</guid>
      <dc:creator>Michael Mike Reaser</dc:creator>
      <dc:date>2009-02-24T19:33:04Z</dc:date>
    </item>
    <item>
      <title>Re: Script addition</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-addition/m-p/5159212#M684337</link>
      <description>James, pardon my ignorance here, however it would look like the attached correct? But in your statement, the else statement would only have it echo out "OK, I saw one arg." i need the else to push the chmod/chown commands.</description>
      <pubDate>Tue, 24 Feb 2009 19:44:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-addition/m-p/5159212#M684337</guid>
      <dc:creator>Adam W.</dc:creator>
      <dc:date>2009-02-24T19:44:50Z</dc:date>
    </item>
    <item>
      <title>Re: Script addition</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-addition/m-p/5159213#M684338</link>
      <description>See this is why I love ITRC. Sometimes I don't know what I would do without the knowledge you guys have.</description>
      <pubDate>Tue, 24 Feb 2009 19:48:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-addition/m-p/5159213#M684338</guid>
      <dc:creator>Adam W.</dc:creator>
      <dc:date>2009-02-24T19:48:33Z</dc:date>
    </item>
    <item>
      <title>Re: Script addition</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-addition/m-p/5159214#M684339</link>
      <description>Hi (again) Adam:&lt;BR /&gt;&lt;BR /&gt;...&lt;BR /&gt;echo "TEST MODE - command would be: 'chown somebody ${FILENAME}'"&lt;BR /&gt;... &lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Tue, 24 Feb 2009 19:53:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-addition/m-p/5159214#M684339</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-02-24T19:53:05Z</dc:date>
    </item>
    <item>
      <title>Re: Script addition</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-addition/m-p/5159215#M684340</link>
      <description>OK, I have attached it. Does it look correct?</description>
      <pubDate>Tue, 24 Feb 2009 20:05:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-addition/m-p/5159215#M684340</guid>
      <dc:creator>Adam W.</dc:creator>
      <dc:date>2009-02-24T20:05:26Z</dc:date>
    </item>
    <item>
      <title>Re: Script addition</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-addition/m-p/5159216#M684341</link>
      <description>Hi Adam:&lt;BR /&gt;&lt;BR /&gt;Please attach a TEXT file.&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Tue, 24 Feb 2009 20:46:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-addition/m-p/5159216#M684341</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-02-24T20:46:27Z</dc:date>
    </item>
    <item>
      <title>Re: Script addition</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-addition/m-p/5159217#M684342</link>
      <description>What text file?</description>
      <pubDate>Tue, 24 Feb 2009 21:08:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-addition/m-p/5159217#M684342</guid>
      <dc:creator>Adam W.</dc:creator>
      <dc:date>2009-02-24T21:08:22Z</dc:date>
    </item>
    <item>
      <title>Re: Script addition</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-addition/m-p/5159218#M684343</link>
      <description>oh lol Sorry about that.</description>
      <pubDate>Tue, 24 Feb 2009 21:09:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-addition/m-p/5159218#M684343</guid>
      <dc:creator>Adam W.</dc:creator>
      <dc:date>2009-02-24T21:09:19Z</dc:date>
    </item>
    <item>
      <title>Re: Script addition</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-addition/m-p/5159219#M684344</link>
      <description>&lt;!--!*#--&gt;Hi Adam:&lt;BR /&gt;&lt;BR /&gt;OK, let's rewrite this now that I see (I think) where you are going and now that I have a text file that I can open and read :-)&lt;BR /&gt;&lt;BR /&gt;# cat /.fixup&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;typeset CMD=""&lt;BR /&gt;[ "$1" = "-d" ] &amp;amp;&amp;amp; CMD=echo&lt;BR /&gt;awk -F":" '$3&amp;gt;100 {print $3,$4,$6}' /etc/passwd | \&lt;BR /&gt;    while read UID GID DIR X&lt;BR /&gt;    do&lt;BR /&gt;        for FILE in .profile .Xauthority .elm .forward .neditdb .sh_history \&lt;BR /&gt;            .ssh2 .sw .exrc .cshrc .login .logout .env .dt&lt;BR /&gt;        do&lt;BR /&gt;            ${CMD} chown ${UID}:$GID ${DIR}/${FILE}&lt;BR /&gt;            ${CMD} chmod 740 ${DIR}/${FILE}&lt;BR /&gt;&lt;BR /&gt;        done&lt;BR /&gt;    done&lt;BR /&gt;exit&lt;BR /&gt;&lt;BR /&gt;...run as:&lt;BR /&gt;&lt;BR /&gt;# ./fixup -d&lt;BR /&gt;&lt;BR /&gt;...to debug; otherwise to actually perform the work, run as:&lt;BR /&gt;&lt;BR /&gt;# ./fixup&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Tue, 24 Feb 2009 21:23:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-addition/m-p/5159219#M684344</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-02-24T21:23:30Z</dc:date>
    </item>
    <item>
      <title>Re: Script addition</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-addition/m-p/5159220#M684345</link>
      <description>Ok so I can run it with a -d to "test" it and without the -d to actually perform the work. Correct? Wow yours looks a lot different than the other one. LOL!</description>
      <pubDate>Tue, 24 Feb 2009 21:32:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-addition/m-p/5159220#M684345</guid>
      <dc:creator>Adam W.</dc:creator>
      <dc:date>2009-02-24T21:32:15Z</dc:date>
    </item>
    <item>
      <title>Re: Script addition</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-addition/m-p/5159221#M684346</link>
      <description>HI (again) Adam:&lt;BR /&gt;&lt;BR /&gt;&amp;gt; Ok so I can run it with a -d to "test" it and without the -d to actually perform the work. Correct?&lt;BR /&gt;&lt;BR /&gt;Yes.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Tue, 24 Feb 2009 21:34:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-addition/m-p/5159221#M684346</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-02-24T21:34:58Z</dc:date>
    </item>
    <item>
      <title>Re: Script addition</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-addition/m-p/5159222#M684347</link>
      <description>James, as usual, your knowledge is extremely beneficial! DOn't ever leave the forums! Thanks Again James!</description>
      <pubDate>Wed, 25 Feb 2009 13:54:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-addition/m-p/5159222#M684347</guid>
      <dc:creator>Adam W.</dc:creator>
      <dc:date>2009-02-25T13:54:39Z</dc:date>
    </item>
    <item>
      <title>Re: Script addition</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-addition/m-p/5159223#M684348</link>
      <description>Hi (again) Adam:&lt;BR /&gt;&lt;BR /&gt;Looking again at your objective, I see two things you need to reconsider:&lt;BR /&gt;&lt;BR /&gt;1.  Some of the objets inyour list are directories; eg. ".sw".  Making the permissions on a directory = 740 means that the group can't search the directory and you might as well make the permissions = 700 since group members are crippled.&lt;BR /&gt;&lt;BR /&gt;2.  If you objective is to change all of the contents of the HOME directories you find, then a _recursive_ chown() and a _recursive_ chmod() might be useful.  See the manpages.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Wed, 25 Feb 2009 14:06:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-addition/m-p/5159223#M684348</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-02-25T14:06:48Z</dc:date>
    </item>
    <item>
      <title>Re: Script addition</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-addition/m-p/5159224#M684349</link>
      <description>James, I actually cought that too, and I removed the directories from the listing. However this does add one more issue. Now I need the .dt and .dtprofile directories to have 755 permissions. Good catch James, thanks for looking out.</description>
      <pubDate>Wed, 25 Feb 2009 16:06:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-addition/m-p/5159224#M684349</guid>
      <dc:creator>Adam W.</dc:creator>
      <dc:date>2009-02-25T16:06:23Z</dc:date>
    </item>
    <item>
      <title>Re: Script addition</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-addition/m-p/5159225#M684350</link>
      <description>James, I know your busy, but would you mind shooting me an e-mail? I would like to pick your brain a bit. If not I understand. Adam.Winebaugh@commandinformation.com</description>
      <pubDate>Wed, 25 Feb 2009 16:16:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-addition/m-p/5159225#M684350</guid>
      <dc:creator>Adam W.</dc:creator>
      <dc:date>2009-02-25T16:16:57Z</dc:date>
    </item>
  </channel>
</rss>

