<?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: how do I write a shell program in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/how-do-i-write-a-shell-program/m-p/2447690#M769732</link>
    <description>Hi:&lt;BR /&gt;&lt;BR /&gt;Oh, sorry, you only wanted the username, so:&lt;BR /&gt;&lt;BR /&gt;# users&lt;BR /&gt;&lt;BR /&gt;...or if you prefer more fancy...&lt;BR /&gt;&lt;BR /&gt;# who|sort|awk '{print $1}' &lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
    <pubDate>Mon, 25 Sep 2000 16:03:06 GMT</pubDate>
    <dc:creator>James R. Ferguson</dc:creator>
    <dc:date>2000-09-25T16:03:06Z</dc:date>
    <item>
      <title>how do I write a shell program</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-do-i-write-a-shell-program/m-p/2447688#M769730</link>
      <description>1. how do I write a shell program to display the number of files in a users current directory. &lt;BR /&gt;&lt;BR /&gt;2. a program to display a sorted list of the logged in users. Just the user name and no other information.&lt;BR /&gt;&lt;BR /&gt;Your help will be greatly appreciated!!</description>
      <pubDate>Mon, 25 Sep 2000 15:56:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-do-i-write-a-shell-program/m-p/2447688#M769730</guid>
      <dc:creator>sanman_2</dc:creator>
      <dc:date>2000-09-25T15:56:33Z</dc:date>
    </item>
    <item>
      <title>Re: how do I write a shell program</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-do-i-write-a-shell-program/m-p/2447689#M769731</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;Try this:&lt;BR /&gt;&lt;BR /&gt;# ls | wc -l&lt;BR /&gt;&lt;BR /&gt;# who | sort | more&lt;BR /&gt;&lt;BR /&gt;..JRF...</description>
      <pubDate>Mon, 25 Sep 2000 16:00:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-do-i-write-a-shell-program/m-p/2447689#M769731</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2000-09-25T16:00:37Z</dc:date>
    </item>
    <item>
      <title>Re: how do I write a shell program</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-do-i-write-a-shell-program/m-p/2447690#M769732</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;Oh, sorry, you only wanted the username, so:&lt;BR /&gt;&lt;BR /&gt;# users&lt;BR /&gt;&lt;BR /&gt;...or if you prefer more fancy...&lt;BR /&gt;&lt;BR /&gt;# who|sort|awk '{print $1}' &lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Mon, 25 Sep 2000 16:03:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-do-i-write-a-shell-program/m-p/2447690#M769732</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2000-09-25T16:03:06Z</dc:date>
    </item>
    <item>
      <title>Re: how do I write a shell program</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-do-i-write-a-shell-program/m-p/2447691#M769733</link>
      <description>don't forget the -a if not you wont get the files begining with a dot i.e .profile&lt;BR /&gt;&lt;BR /&gt;ls -a | wc -l&lt;BR /&gt;&lt;BR /&gt;or if you want a recursive method&lt;BR /&gt;&lt;BR /&gt;find . | wc -l</description>
      <pubDate>Mon, 25 Sep 2000 16:24:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-do-i-write-a-shell-program/m-p/2447691#M769733</guid>
      <dc:creator>Anthony Goonetilleke</dc:creator>
      <dc:date>2000-09-25T16:24:09Z</dc:date>
    </item>
    <item>
      <title>Re: how do I write a shell program</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-do-i-write-a-shell-program/m-p/2447692#M769734</link>
      <description>Number files in a users home directory:&lt;BR /&gt;&lt;BR /&gt;cd $HOME       (users home directory)&lt;BR /&gt;find . -depth | wc -l&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Users logged in:&lt;BR /&gt;&lt;BR /&gt;who | awk '{print $1}' | sort | uniq -c&lt;BR /&gt;This will list all users who are logged in but if you only want to see the user names once, this is providing the unique feature. If a username appears more than once in the output, the 'uniq -c' will eliminate the duplicates and show the name once.</description>
      <pubDate>Mon, 25 Sep 2000 17:49:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-do-i-write-a-shell-program/m-p/2447692#M769734</guid>
      <dc:creator>Rick Garland</dc:creator>
      <dc:date>2000-09-25T17:49:09Z</dc:date>
    </item>
    <item>
      <title>Re: how do I write a shell program</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-do-i-write-a-shell-program/m-p/2447693#M769735</link>
      <description>You can use sort -u instead of sort | uniq. So this would read:&lt;BR /&gt;&lt;BR /&gt;who | awk '{print $1}' | sort -u&lt;BR /&gt;&lt;BR /&gt;This saves you one command and will be a little bit faster.</description>
      <pubDate>Tue, 26 Sep 2000 04:45:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-do-i-write-a-shell-program/m-p/2447693#M769735</guid>
      <dc:creator>Stefan Schulz</dc:creator>
      <dc:date>2000-09-26T04:45:03Z</dc:date>
    </item>
    <item>
      <title>Re: how do I write a shell program</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-do-i-write-a-shell-program/m-p/2447694#M769736</link>
      <description>&lt;BR /&gt;If you are searching all the files in a user directory you should use the find command because it recuyrsively discends the directory hierarchy for the path you fornish:.&lt;BR /&gt;You could use this form:&lt;BR /&gt;&lt;BR /&gt;find user_dir -type f | awk '{print "TOTAL FILES =&amp;gt; "  NR }'&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;and about the users logged in :&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;who | awk '{print $1}'| sort -u &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;federico</description>
      <pubDate>Tue, 26 Sep 2000 08:33:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-do-i-write-a-shell-program/m-p/2447694#M769736</guid>
      <dc:creator>federico_3</dc:creator>
      <dc:date>2000-09-26T08:33:32Z</dc:date>
    </item>
  </channel>
</rss>

