<?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: Scripting Novice in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-novice/m-p/5157502#M684209</link>
    <description>&amp;gt;but filter out anything that is a directory.&lt;BR /&gt;&lt;BR /&gt;Try this instead:&lt;BR /&gt;ll | grep -v "^d"&lt;BR /&gt;&lt;BR /&gt;&amp;gt;but it will have to be issued by sudo&lt;BR /&gt;&lt;BR /&gt;It shouldn't make a difference, unless /usr/bin isn't in root's path.  (No /sbin/ll.)</description>
    <pubDate>Tue, 17 Feb 2009 11:07:28 GMT</pubDate>
    <dc:creator>Dennis Handly</dc:creator>
    <dc:date>2009-02-17T11:07:28Z</dc:date>
    <item>
      <title>Scripting Novice</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-novice/m-p/5157501#M684208</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;I am still a scripting novice and so it still cause me headaches doing the easiest stuff. I wonder if you can help.&lt;BR /&gt;&lt;BR /&gt;I want to pull out an long listing of a directory (not my current working dir) but filter out anything that is a directory. So i thought about using the command;&lt;BR /&gt;&lt;BR /&gt;ls -lp | grep -v /&lt;BR /&gt;&lt;BR /&gt;This works fine on the current working directory, but i wonder how i can integrate this into a script to get this listing from another directory.&lt;BR /&gt;&lt;BR /&gt;Or please can you offer any other ways of getting a listing of just the files only in a directory, without it being your current working directory.&lt;BR /&gt;&lt;BR /&gt;PS: Dont know if it makes any difference but it will have to be issued by sudo, so the command will be something like;&lt;BR /&gt;&lt;BR /&gt;sudo -u root &lt;COMMAND&gt; &lt;DIRECTORY&gt;&lt;/DIRECTORY&gt;&lt;/COMMAND&gt;</description>
      <pubDate>Tue, 17 Feb 2009 10:47:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-novice/m-p/5157501#M684208</guid>
      <dc:creator>Acxiom Unix Team</dc:creator>
      <dc:date>2009-02-17T10:47:11Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting Novice</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-novice/m-p/5157502#M684209</link>
      <description>&amp;gt;but filter out anything that is a directory.&lt;BR /&gt;&lt;BR /&gt;Try this instead:&lt;BR /&gt;ll | grep -v "^d"&lt;BR /&gt;&lt;BR /&gt;&amp;gt;but it will have to be issued by sudo&lt;BR /&gt;&lt;BR /&gt;It shouldn't make a difference, unless /usr/bin isn't in root's path.  (No /sbin/ll.)</description>
      <pubDate>Tue, 17 Feb 2009 11:07:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-novice/m-p/5157502#M684209</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2009-02-17T11:07:28Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting Novice</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-novice/m-p/5157503#M684210</link>
      <description>Try this instead:&lt;BR /&gt;ll | grep -v "^d"&lt;BR /&gt;&lt;BR /&gt;Just to help - this is using the fact that directories have a 'd' at the start of the permissions. So this is removing newline followed by 'd'</description>
      <pubDate>Tue, 17 Feb 2009 11:13:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-novice/m-p/5157503#M684210</guid>
      <dc:creator>Mark McDonald_2</dc:creator>
      <dc:date>2009-02-17T11:13:52Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting Novice</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-novice/m-p/5157504#M684211</link>
      <description>&lt;!--!*#--&gt;HI,&lt;BR /&gt;if you want all the file in a directory you could do&lt;BR /&gt;find $DIRECTORY -type f</description>
      <pubDate>Tue, 17 Feb 2009 11:17:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-novice/m-p/5157504#M684211</guid>
      <dc:creator>smatador</dc:creator>
      <dc:date>2009-02-17T11:17:04Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting Novice</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-novice/m-p/5157505#M684212</link>
      <description>Hi Andrew,&lt;BR /&gt;&lt;BR /&gt;If you want to long list only files on specific directory, use this command&lt;BR /&gt;&lt;BR /&gt;#ll &lt;DIRNAME&gt; |grep -v ^d&lt;BR /&gt;&lt;BR /&gt;Ex: ll /tmp |grep -v ^d&lt;BR /&gt;&lt;BR /&gt;With sudo&lt;BR /&gt;&lt;BR /&gt;#sudo -u root ll /tmp |grep -v ^d&lt;BR /&gt;&lt;/DIRNAME&gt;</description>
      <pubDate>Tue, 17 Feb 2009 11:36:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-novice/m-p/5157505#M684212</guid>
      <dc:creator>Ganesan R</dc:creator>
      <dc:date>2009-02-17T11:36:35Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting Novice</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-novice/m-p/5157506#M684213</link>
      <description>Thanks guys.&lt;BR /&gt;&lt;BR /&gt;And thanks for the explanation Mark of what it actually does.&lt;BR /&gt;&lt;BR /&gt;But one more quick question.&lt;BR /&gt;&lt;BR /&gt;If i wanted to run that command ll | grep -v "^d" on a directory that was not my current working directory could that be done? I am guessing so but i just can figure it out as simply doing that command followed by a directory doesnt work.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 17 Feb 2009 11:39:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-novice/m-p/5157506#M684213</guid>
      <dc:creator>Acxiom Unix Team</dc:creator>
      <dc:date>2009-02-17T11:39:14Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting Novice</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-novice/m-p/5157507#M684214</link>
      <description>Sorry, forget last posting. Ganesan R has answered my question and shown how daft i am being...&lt;BR /&gt;&lt;BR /&gt;I will assign points and then close the call.&lt;BR /&gt;&lt;BR /&gt;Thanks Again everyone......</description>
      <pubDate>Tue, 17 Feb 2009 11:40:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-novice/m-p/5157507#M684214</guid>
      <dc:creator>Acxiom Unix Team</dc:creator>
      <dc:date>2009-02-17T11:40:46Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting Novice</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-novice/m-p/5157508#M684215</link>
      <description>I was given the answer by various people...Ta</description>
      <pubDate>Tue, 17 Feb 2009 11:41:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-novice/m-p/5157508#M684215</guid>
      <dc:creator>Acxiom Unix Team</dc:creator>
      <dc:date>2009-02-17T11:41:58Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting Novice</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-novice/m-p/5157509#M684216</link>
      <description>Shalom,&lt;BR /&gt;&lt;BR /&gt;cd into the directory before running the command.&lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Tue, 17 Feb 2009 12:08:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-novice/m-p/5157509#M684216</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2009-02-17T12:08:28Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting Novice</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-novice/m-p/5157510#M684217</link>
      <description>hue.. you need to spend some time getting to know the basic unix commands. sure you can do an ls and then filter out anything which is not a file, but why would you do that when 'find' does those things for you?&lt;BR /&gt;&lt;BR /&gt;find &lt;PATH&gt; -type f &amp;lt;- shows only files&lt;BR /&gt;find &lt;PATH&gt; -type f &amp;lt;- will show only dirs&lt;BR /&gt;&lt;BR /&gt;and find has many options which will get you were you want to go next.&lt;/PATH&gt;&lt;/PATH&gt;</description>
      <pubDate>Wed, 18 Feb 2009 09:53:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-novice/m-p/5157510#M684217</guid>
      <dc:creator>dirk dierickx</dc:creator>
      <dc:date>2009-02-18T09:53:50Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting Novice</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-novice/m-p/5157511#M684218</link>
      <description>&amp;gt;Dirk: but why would you do that when 'find' does those things for you?&lt;BR /&gt;&lt;BR /&gt;Because find(1) just gives names and you would have to feed it back to ll(1) anyway?  Because find will descend directories and the stinkin' documentation doesn't tell you how to to use -prune?&lt;BR /&gt;But you could be right.  Andrew asked how to use grep to get something but perhaps not what he really wanted.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;find &lt;PATH&gt; -type f &amp;lt;- will show only dirs&lt;BR /&gt;&lt;BR /&gt;That's: -type d&lt;/PATH&gt;</description>
      <pubDate>Wed, 18 Feb 2009 11:50:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-novice/m-p/5157511#M684218</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2009-02-18T11:50:14Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting Novice</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-novice/m-p/5157512#M684219</link>
      <description>that last one was a typo ofcourse :|&lt;BR /&gt;&lt;BR /&gt;after rereading his post i noticed he wanted a 'long listing' of a directory, which probably means he needs the ownership and rights as well, grepping ll could be the fastest way to get there.</description>
      <pubDate>Thu, 19 Feb 2009 06:29:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-novice/m-p/5157512#M684219</guid>
      <dc:creator>dirk dierickx</dc:creator>
      <dc:date>2009-02-19T06:29:27Z</dc:date>
    </item>
  </channel>
</rss>

