<?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: HELP to made a Script in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/help-to-made-a-script/m-p/4974764#M418682</link>
    <description>I think a little more detail of your problem would be helpful.&lt;BR /&gt; &lt;BR /&gt;Rod Hills</description>
    <pubDate>Thu, 20 Apr 2006 16:18:30 GMT</pubDate>
    <dc:creator>Rodney Hills</dc:creator>
    <dc:date>2006-04-20T16:18:30Z</dc:date>
    <item>
      <title>HELP to made a Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-to-made-a-script/m-p/4974760#M418678</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;I need move one file from a directory but i need move the most recent from the original directory. ( in original directory have many files equals )&lt;BR /&gt;Some body can help me !&lt;BR /&gt;&lt;BR /&gt;Thank you</description>
      <pubDate>Thu, 20 Apr 2006 14:23:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-to-made-a-script/m-p/4974760#M418678</guid>
      <dc:creator>Isaac_4</dc:creator>
      <dc:date>2006-04-20T14:23:03Z</dc:date>
    </item>
    <item>
      <title>Re: HELP to made a Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-to-made-a-script/m-p/4974761#M418679</link>
      <description>I assume the names are similar.  You could try something like:&lt;BR /&gt;&lt;BR /&gt;rm `ls -t filename.* |head -r |tail -1`&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Pete</description>
      <pubDate>Thu, 20 Apr 2006 14:26:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-to-made-a-script/m-p/4974761#M418679</guid>
      <dc:creator>Pete Randall</dc:creator>
      <dc:date>2006-04-20T14:26:17Z</dc:date>
    </item>
    <item>
      <title>Re: HELP to made a Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-to-made-a-script/m-p/4974762#M418680</link>
      <description>No I dont need remove i need made a copy</description>
      <pubDate>Thu, 20 Apr 2006 14:34:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-to-made-a-script/m-p/4974762#M418680</guid>
      <dc:creator>Isaac_4</dc:creator>
      <dc:date>2006-04-20T14:34:30Z</dc:date>
    </item>
    <item>
      <title>Re: HELP to made a Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-to-made-a-script/m-p/4974763#M418681</link>
      <description>Hi Isaac:&lt;BR /&gt;&lt;BR /&gt;Assuming that you do not want to examine subordinate directories, but only want the most recently modified file, do:&lt;BR /&gt;&lt;BR /&gt;# cd yourdir&lt;BR /&gt;# FILE=`ls -lt|awk '/^-/ {print $NF}'|head -1`&lt;BR /&gt;# mv ${FILE} destdir&lt;BR /&gt;&lt;BR /&gt;The 'ls -lt' lists files in modification timestamp order; the most recent first.  We look only for regular files with 'awk' printing the file names, and take only the first one in the ouput stream with 'head'.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 20 Apr 2006 14:36:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-to-made-a-script/m-p/4974763#M418681</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2006-04-20T14:36:54Z</dc:date>
    </item>
    <item>
      <title>Re: HELP to made a Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-to-made-a-script/m-p/4974764#M418682</link>
      <description>I think a little more detail of your problem would be helpful.&lt;BR /&gt; &lt;BR /&gt;Rod Hills</description>
      <pubDate>Thu, 20 Apr 2006 16:18:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-to-made-a-script/m-p/4974764#M418682</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2006-04-20T16:18:30Z</dc:date>
    </item>
    <item>
      <title>Re: HELP to made a Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-to-made-a-script/m-p/4974765#M418683</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;a little modification of James solution, &lt;BR /&gt;to avoid an error message when no file is found:&lt;BR /&gt;&lt;BR /&gt;cd yourdir&lt;BR /&gt;FILE=`ls -t | sed 1q`&lt;BR /&gt;[ "$FILE" ] &amp;amp;&amp;amp; mv ${FILE} destdir&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;mfG Peter</description>
      <pubDate>Fri, 21 Apr 2006 04:19:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-to-made-a-script/m-p/4974765#M418683</guid>
      <dc:creator>Peter Nikitka</dc:creator>
      <dc:date>2006-04-21T04:19:11Z</dc:date>
    </item>
    <item>
      <title>Re: HELP to made a Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-to-made-a-script/m-p/4974766#M418684</link>
      <description>Sorry for the follow up post,&lt;BR /&gt;&lt;BR /&gt;but just saw the checking for a plain file, so:&lt;BR /&gt;&lt;BR /&gt;cd yourdir&lt;BR /&gt;FILE=`ls -t | sed 1q`&lt;BR /&gt;[ -n "$FILE" -a -f "$FILE" ] &amp;amp;&amp;amp; mv ${FILE} destdir&lt;BR /&gt;&lt;BR /&gt;mfG</description>
      <pubDate>Fri, 21 Apr 2006 04:31:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-to-made-a-script/m-p/4974766#M418684</guid>
      <dc:creator>Peter Nikitka</dc:creator>
      <dc:date>2006-04-21T04:31:10Z</dc:date>
    </item>
    <item>
      <title>Re: HELP to made a Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-to-made-a-script/m-p/4974767#M418685</link>
      <description>OLDDIR="" #Set the current dir of the file&lt;BR /&gt;NEWDIR="" #Set the new dir of the file&lt;BR /&gt;&lt;BR /&gt;cd $OLDDIR&lt;BR /&gt;set -A ARRAY1 $(ll -lt |grep "^-" |tail -1 | cut -d " " -f2-)&lt;BR /&gt;&lt;BR /&gt;mv ${ARRAY1[$(print ${#ARRAY1[*]} - 1 |bc)]} $NEWDIR</description>
      <pubDate>Fri, 21 Apr 2006 15:01:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-to-made-a-script/m-p/4974767#M418685</guid>
      <dc:creator>Josiah Henline</dc:creator>
      <dc:date>2006-04-21T15:01:53Z</dc:date>
    </item>
    <item>
      <title>Re: HELP to made a Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-to-made-a-script/m-p/4974768#M418686</link>
      <description>OLDDIR="" #Set the current dir of the file&lt;BR /&gt;NEWDIR="" #Set the new dir of the file&lt;BR /&gt;&lt;BR /&gt;cd $OLDDIR&lt;BR /&gt;set -A ARRAY1 $(ll -lrt |grep "^-" |tail -1 | cut -d " " -f2-)&lt;BR /&gt;&lt;BR /&gt;mv ${ARRAY1[$(print ${#ARRAY1[*]} - 1 |bc)]} $NEWDIR&lt;BR /&gt;&lt;BR /&gt;Sorry... forgot the "-r". It is needed for me to use the "tail" command.</description>
      <pubDate>Fri, 21 Apr 2006 15:06:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-to-made-a-script/m-p/4974768#M418686</guid>
      <dc:creator>Josiah Henline</dc:creator>
      <dc:date>2006-04-21T15:06:29Z</dc:date>
    </item>
    <item>
      <title>Re: HELP to made a Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-to-made-a-script/m-p/4974769#M418687</link>
      <description>Thank you for you help &lt;BR /&gt;thanks Josiah, Peter, Pete , James R. all this good boys help me to open my eyes !!!&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 21 Apr 2006 17:08:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-to-made-a-script/m-p/4974769#M418687</guid>
      <dc:creator>Isaac_4</dc:creator>
      <dc:date>2006-04-21T17:08:48Z</dc:date>
    </item>
  </channel>
</rss>

