<?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: Question about execute and read bits in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/question-about-execute-and-read-bits/m-p/3854446#M275533</link>
    <description>Hi Clay,&lt;BR /&gt;&lt;BR /&gt;I compiled your Hello World program and set only the execute bit. I did see "Hello World!" showing that only the execute bit is needed.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;David&lt;BR /&gt;</description>
    <pubDate>Thu, 31 Aug 2006 16:23:52 GMT</pubDate>
    <dc:creator>David Yandry</dc:creator>
    <dc:date>2006-08-31T16:23:52Z</dc:date>
    <item>
      <title>Question about execute and read bits</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/question-about-execute-and-read-bits/m-p/3854441#M275528</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I'm studying for the CSA exam and I have a question. Do both the read bit and the execute bit have to be set so that the file can be executed by a regular user? My study materials say yes but I thought I remembered seeing a thread that said that was not true.&lt;BR /&gt;&lt;BR /&gt;Does anyone remember that thread or know the answer for sure?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;TIA,&lt;BR /&gt;David&lt;BR /&gt;</description>
      <pubDate>Thu, 31 Aug 2006 10:49:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/question-about-execute-and-read-bits/m-p/3854441#M275528</guid>
      <dc:creator>David Yandry</dc:creator>
      <dc:date>2006-08-31T10:49:12Z</dc:date>
    </item>
    <item>
      <title>Re: Question about execute and read bits</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/question-about-execute-and-read-bits/m-p/3854442#M275529</link>
      <description>Well David, this is a tough question not because of the question itself. The correct answer is a resounding "NO" -- only the execute bit must be set BUT that may not be the correct test answer. If the question, for example, pertains to a shell script then the read bit is also necessary but in the strictest sense, a shell script is not an executable because it relies upon an underlying true executable (the shell) to actually execute.&lt;BR /&gt;</description>
      <pubDate>Thu, 31 Aug 2006 10:52:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/question-about-execute-and-read-bits/m-p/3854442#M275529</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2006-08-31T10:52:45Z</dc:date>
    </item>
    <item>
      <title>Re: Question about execute and read bits</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/question-about-execute-and-read-bits/m-p/3854443#M275530</link>
      <description>Oh, and this is one of those questions that you should ask the box itself; on account of, I might lie to you and whatever study guides you may be using may lie to you but the box don't lie. Try this:&lt;BR /&gt;&lt;BR /&gt;Create a small file, hello.c:&lt;BR /&gt;----------------------------------&lt;BR /&gt;int main()&lt;BR /&gt;{&lt;BR /&gt;  (void) printf("Hello World!\n");&lt;BR /&gt;  return(0);&lt;BR /&gt;} &lt;BR /&gt;-----------------------------------&lt;BR /&gt;Now compile it:&lt;BR /&gt;cc hello.c -o hello&lt;BR /&gt;&lt;BR /&gt;Now, let's set ONLY the execute for the file owner (presumably you):&lt;BR /&gt;chmod 100 hello&lt;BR /&gt;&lt;BR /&gt;Now let's try to execute it:&lt;BR /&gt;hello&lt;BR /&gt;&lt;BR /&gt;If you see "Hello World!" then only the execute is necessary; otherwise you also need the read bit.&lt;BR /&gt;&lt;BR /&gt;Q.E.D.&lt;BR /&gt;&lt;BR /&gt;Sadly, however, this may or may not tell you what is the "correct" test answer.&lt;BR /&gt;</description>
      <pubDate>Thu, 31 Aug 2006 10:58:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/question-about-execute-and-read-bits/m-p/3854443#M275530</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2006-08-31T10:58:08Z</dc:date>
    </item>
    <item>
      <title>Re: Question about execute and read bits</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/question-about-execute-and-read-bits/m-p/3854444#M275531</link>
      <description>Hello David,&lt;BR /&gt;I believe that Clay is correct in the execute bit for a executable binary but keep in mind that a file needs to have its read bit set in order to be open and its content examined by the O/S. Thus a binary (compiled object) needs the read bit and the execute bit set. Shell script in the other hand do not require the execute bit as Clay correctly mentioned. However the read bit again is required by the shell to be able to read and interpret the command contained in the file.&lt;BR /&gt;Having gone through the CSA examination I believe that they are asking about shell scripts but.. hey the answer depends on the actual question you will be presented with.&lt;BR /&gt;I hope this is of assistance... good luck with the examination.&lt;BR /&gt;RV&lt;BR /&gt;</description>
      <pubDate>Thu, 31 Aug 2006 14:00:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/question-about-execute-and-read-bits/m-p/3854444#M275531</guid>
      <dc:creator>Roboz</dc:creator>
      <dc:date>2006-08-31T14:00:40Z</dc:date>
    </item>
    <item>
      <title>Re: Question about execute and read bits</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/question-about-execute-and-read-bits/m-p/3854445#M275532</link>
      <description>Actually, the shell script only requires the read bit because it is a data file. For example,"sh myfile" will execute the shell and treat myfile as data so ONLY the read bit needs to be set it that case. However, if both the read and execute are set then one can simply "execute" myfile and the script will run. I use "execute" in quotes in this context because again, the shell is the real executable and "myfile" is data.&lt;BR /&gt;&lt;BR /&gt;An interesting aside is that if the exec() system call sees the magic number 043041 (octal) as the 1st two bytes of an executable file (#!) then it expects to see an executable follow and that is why, for example, if the first line of a script looks like:&lt;BR /&gt;#! /usr/bin/perl&lt;BR /&gt;or &lt;BR /&gt;#! /usr/bin/sh&lt;BR /&gt;then exec() starts /usr/bin/perl or &lt;BR /&gt;#! /usr/bin/sh  as the actual executable and treats the remainder of the file as data for the executable. --- and that is how the "shebang" works.&lt;BR /&gt; &lt;BR /&gt;Nevertheless, for the question as originally stated the correct answer is only the execute bit need be set --- but that may be wrong answer for the test -- but that's your problem, not mine.&lt;BR /&gt;</description>
      <pubDate>Thu, 31 Aug 2006 14:46:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/question-about-execute-and-read-bits/m-p/3854445#M275532</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2006-08-31T14:46:28Z</dc:date>
    </item>
    <item>
      <title>Re: Question about execute and read bits</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/question-about-execute-and-read-bits/m-p/3854446#M275533</link>
      <description>Hi Clay,&lt;BR /&gt;&lt;BR /&gt;I compiled your Hello World program and set only the execute bit. I did see "Hello World!" showing that only the execute bit is needed.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;David&lt;BR /&gt;</description>
      <pubDate>Thu, 31 Aug 2006 16:23:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/question-about-execute-and-read-bits/m-p/3854446#M275533</guid>
      <dc:creator>David Yandry</dc:creator>
      <dc:date>2006-08-31T16:23:52Z</dc:date>
    </item>
    <item>
      <title>Re: Question about execute and read bits</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/question-about-execute-and-read-bits/m-p/3854447#M275534</link>
      <description>Quod Erat Demonstrandum.&lt;BR /&gt;&lt;BR /&gt;Good for you. Now you know the correct answer it just may not be the "right" answer --- but that's a personal problem.&lt;BR /&gt;</description>
      <pubDate>Thu, 31 Aug 2006 16:32:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/question-about-execute-and-read-bits/m-p/3854447#M275534</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2006-08-31T16:32:53Z</dc:date>
    </item>
  </channel>
</rss>

