<?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: need help for shell script in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/need-help-for-shell-script/m-p/4241808#M330097</link>
    <description>Hi:&lt;BR /&gt;&lt;BR /&gt;Use Perl;&lt;BR /&gt;&lt;BR /&gt;# perl -le 'printf("%04o %-s\n",((stat($_))[2])&amp;amp;07777,$_) for @ARGV' file_or_directory&lt;BR /&gt;&lt;BR /&gt;That is, pass one or more arguments for 'file_or_directory'.  For example:&lt;BR /&gt;&lt;BR /&gt;# perl -le 'printf("%04o %-s\n",((stat($_))[2])&amp;amp;07777,$_) for @ARGV' /var/tmp /home /etc/hosts&lt;BR /&gt;1777 /var/tmp&lt;BR /&gt;0755 /home&lt;BR /&gt;0644 /etc/hosts&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;</description>
    <pubDate>Tue, 29 Jul 2008 11:17:20 GMT</pubDate>
    <dc:creator>James R. Ferguson</dc:creator>
    <dc:date>2008-07-29T11:17:20Z</dc:date>
    <item>
      <title>need help for shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/need-help-for-shell-script/m-p/4241806#M330095</link>
      <description>Dear Unix Expertise,&lt;BR /&gt;&lt;BR /&gt;I need your help to write following shell script, as i am new to this area...&lt;BR /&gt;&lt;BR /&gt;----------&lt;BR /&gt;&lt;BR /&gt;Display the Octal value of Root Home Directory (700 / 750 / 777), User Home Directory and Application  Home Directory...&lt;BR /&gt;&lt;BR /&gt;For e.g. Result  Should be like :&lt;BR /&gt;&lt;BR /&gt;"Root Home Directory Octal Value : 700"&lt;BR /&gt;&lt;BR /&gt;I want the OCTAL STATUS Output for  each of these direcotries..&lt;BR /&gt;&lt;BR /&gt;Pl. help me for this.&lt;BR /&gt;Thanks in Advance...&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Mikin</description>
      <pubDate>Tue, 29 Jul 2008 03:49:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/need-help-for-shell-script/m-p/4241806#M330095</guid>
      <dc:creator>Mikin Shah</dc:creator>
      <dc:date>2008-07-29T03:49:08Z</dc:date>
    </item>
    <item>
      <title>Re: need help for shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/need-help-for-shell-script/m-p/4241807#M330096</link>
      <description>&lt;!--!*#--&gt;You could just use something like the following.  It doesn't handle sticky or setuid or setgid bits.&lt;BR /&gt;#!/usr/bin/ksh&lt;BR /&gt;&lt;BR /&gt;#Display the Octal value of Root Home Directory (700 / 750 / 777),&lt;BR /&gt;#User Home Directory and Application Home Directory...&lt;BR /&gt;&lt;BR /&gt;decode_3() {&lt;BR /&gt;   octal=$1&lt;BR /&gt;   r=${octal%??}&lt;BR /&gt;   octal=${octal#?}  # remove r&lt;BR /&gt;   w=${octal%?}&lt;BR /&gt;   x=${octal#?}  # remove w&lt;BR /&gt;#   echo "r:$r w:$w x:$x"&lt;BR /&gt;   typeset -i total=0&lt;BR /&gt;   if [ "$r" = "r" ]; then&lt;BR /&gt;      (( total += 4 ))&lt;BR /&gt;   fi&lt;BR /&gt;   if [ "$w" = "w" ]; then&lt;BR /&gt;      (( total += 2 ))&lt;BR /&gt;   fi&lt;BR /&gt;   if [ "$x" = "x" ]; then&lt;BR /&gt;      (( total += 1 ))&lt;BR /&gt;   fi&lt;BR /&gt;   echo $total&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;decode_permission() {&lt;BR /&gt;   perm=${1#?}  # remove first&lt;BR /&gt;   u_perm=${perm%??????}&lt;BR /&gt;   perm=${perm#???}  # remove user&lt;BR /&gt;   g_perm=${perm%???}&lt;BR /&gt;   o_perm=${perm#???}  # remove group&lt;BR /&gt;#   echo "u:$u_perm g:$g_perm o:$o_perm $2"&lt;BR /&gt;   echo "$(decode_3 $u_perm)$(decode_3 $g_perm)$(decode_3 $o_perm) $2"&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;for file in ~root ~ $*; do&lt;BR /&gt;   decode_permission $(ll -d $file | awk '{print $1, $9}')&lt;BR /&gt;done</description>
      <pubDate>Tue, 29 Jul 2008 05:30:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/need-help-for-shell-script/m-p/4241807#M330096</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2008-07-29T05:30:00Z</dc:date>
    </item>
    <item>
      <title>Re: need help for shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/need-help-for-shell-script/m-p/4241808#M330097</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;Use Perl;&lt;BR /&gt;&lt;BR /&gt;# perl -le 'printf("%04o %-s\n",((stat($_))[2])&amp;amp;07777,$_) for @ARGV' file_or_directory&lt;BR /&gt;&lt;BR /&gt;That is, pass one or more arguments for 'file_or_directory'.  For example:&lt;BR /&gt;&lt;BR /&gt;# perl -le 'printf("%04o %-s\n",((stat($_))[2])&amp;amp;07777,$_) for @ARGV' /var/tmp /home /etc/hosts&lt;BR /&gt;1777 /var/tmp&lt;BR /&gt;0755 /home&lt;BR /&gt;0644 /etc/hosts&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;</description>
      <pubDate>Tue, 29 Jul 2008 11:17:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/need-help-for-shell-script/m-p/4241808#M330097</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2008-07-29T11:17:20Z</dc:date>
    </item>
    <item>
      <title>Re: need help for shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/need-help-for-shell-script/m-p/4241809#M330098</link>
      <description>Courtesy of Jack Mahaffey, here's "getchmod" (attached).&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Pete</description>
      <pubDate>Tue, 29 Jul 2008 11:22:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/need-help-for-shell-script/m-p/4241809#M330098</guid>
      <dc:creator>Pete Randall</dc:creator>
      <dc:date>2008-07-29T11:22:25Z</dc:date>
    </item>
  </channel>
</rss>

