<?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: script problem in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/script-problem/m-p/4933921#M410470</link>
    <description>I personally would take a cheating way:&lt;BR /&gt;&lt;BR /&gt;for a in `ls  al a* | grep  v ae | awk  {print $9} `&lt;BR /&gt;do&lt;BR /&gt;cp $a /destination&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;Note the use of ` ` around your command.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Mon, 17 Oct 2005 01:48:58 GMT</pubDate>
    <dc:creator>John Waller</dc:creator>
    <dc:date>2005-10-17T01:48:58Z</dc:date>
    <item>
      <title>script problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-problem/m-p/4933920#M410469</link>
      <description>Hi all,&lt;BR /&gt;&lt;BR /&gt;I am doing some scripting, to copy some files source to destination.&lt;BR /&gt;&lt;BR /&gt;I have about 25 files in current location, I want to copy all the files which starts from the letter a* ,out of which i don't want to copy a particular file which starts ae*&lt;BR /&gt;&lt;BR /&gt;What I have written this&lt;BR /&gt;&lt;BR /&gt;ls –al a* | grep –v ae | awk ‘{print $9}’&lt;BR /&gt;&lt;BR /&gt;this is will give me the output, but i want to know how to copy all these files (i mean which comes as output of awk command)</description>
      <pubDate>Mon, 17 Oct 2005 01:44:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-problem/m-p/4933920#M410469</guid>
      <dc:creator>Hari Prasad S R</dc:creator>
      <dc:date>2005-10-17T01:44:08Z</dc:date>
    </item>
    <item>
      <title>Re: script problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-problem/m-p/4933921#M410470</link>
      <description>I personally would take a cheating way:&lt;BR /&gt;&lt;BR /&gt;for a in `ls  al a* | grep  v ae | awk  {print $9} `&lt;BR /&gt;do&lt;BR /&gt;cp $a /destination&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;Note the use of ` ` around your command.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 17 Oct 2005 01:48:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-problem/m-p/4933921#M410470</guid>
      <dc:creator>John Waller</dc:creator>
      <dc:date>2005-10-17T01:48:58Z</dc:date>
    </item>
    <item>
      <title>Re: script problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-problem/m-p/4933922#M410471</link>
      <description>You can do as,&lt;BR /&gt;&lt;BR /&gt;for file in `ls -al a* | grep -Ev 'ae|total' | awk '{ print $9 }'`&lt;BR /&gt;do&lt;BR /&gt;  cp -i ${file} &lt;DESTINATION&gt;&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;Note: Negate grep for total string for using ls -l&lt;BR /&gt;&lt;BR /&gt;hth.&lt;/DESTINATION&gt;</description>
      <pubDate>Mon, 17 Oct 2005 01:52:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-problem/m-p/4933922#M410471</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2005-10-17T01:52:13Z</dc:date>
    </item>
    <item>
      <title>Re: script problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-problem/m-p/4933923#M410472</link>
      <description>I am sorry no need to negate with total string. Simply as,&lt;BR /&gt;&lt;BR /&gt;for file in `ls -al a* | awk '!/ae/{ print $9 }'`&lt;BR /&gt;do&lt;BR /&gt;cp -i ${file} &lt;DESTINATION&gt;&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;hth.&lt;/DESTINATION&gt;</description>
      <pubDate>Mon, 17 Oct 2005 01:53:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-problem/m-p/4933923#M410472</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2005-10-17T01:53:41Z</dc:date>
    </item>
    <item>
      <title>Re: script problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-problem/m-p/4933924#M410473</link>
      <description>ls -al a[!e]* | awk '{ print "cp "$9" /tmp" }' | ksh&lt;BR /&gt;&lt;BR /&gt;It will copy all files to /tmp location. Change destination location accordingly.&lt;BR /&gt;&lt;BR /&gt;hth.</description>
      <pubDate>Mon, 17 Oct 2005 01:56:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-problem/m-p/4933924#M410473</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2005-10-17T01:56:03Z</dc:date>
    </item>
    <item>
      <title>Re: script problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-problem/m-p/4933925#M410474</link>
      <description>Hi Muthukumar,&lt;BR /&gt;&lt;BR /&gt;why we need ksh at the end, i am doing this bash&lt;BR /&gt;&lt;BR /&gt;thanks</description>
      <pubDate>Mon, 17 Oct 2005 01:57:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-problem/m-p/4933925#M410474</guid>
      <dc:creator>Hari Prasad S R</dc:creator>
      <dc:date>2005-10-17T01:57:37Z</dc:date>
    </item>
    <item>
      <title>Re: script problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-problem/m-p/4933926#M410475</link>
      <description>ls -al1 a[a-df-z]*&lt;BR /&gt;&lt;BR /&gt;Will also do it.</description>
      <pubDate>Mon, 17 Oct 2005 01:58:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-problem/m-p/4933926#M410475</guid>
      <dc:creator>RAC_1</dc:creator>
      <dc:date>2005-10-17T01:58:53Z</dc:date>
    </item>
    <item>
      <title>Re: script problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-problem/m-p/4933927#M410476</link>
      <description>You should also use shell wildcards to filter the files you want instead of invoking three commands (ls,grep and awk)&lt;BR /&gt;Also this eliminates the need for a loop.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Just use&lt;BR /&gt;&lt;BR /&gt;cp /sourcedir/a[!e]* /destdir/&lt;BR /&gt;&lt;BR /&gt;for local or&lt;BR /&gt;&lt;BR /&gt;scp /sourcedir/a[!e]* remote_host:/destdir/&lt;BR /&gt;&lt;BR /&gt;for remote copying.&lt;BR /&gt;&lt;BR /&gt;hth&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 17 Oct 2005 02:00:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-problem/m-p/4933927#M410476</guid>
      <dc:creator>Orhan Biyiklioglu</dc:creator>
      <dc:date>2005-10-17T02:00:24Z</dc:date>
    </item>
    <item>
      <title>Re: script problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-problem/m-p/4933928#M410477</link>
      <description>thanks Orhan Biyiklioglu ,&lt;BR /&gt;&lt;BR /&gt;it worked for me</description>
      <pubDate>Mon, 17 Oct 2005 02:03:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-problem/m-p/4933928#M410477</guid>
      <dc:creator>Hari Prasad S R</dc:creator>
      <dc:date>2005-10-17T02:03:08Z</dc:date>
    </item>
    <item>
      <title>Re: script problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-problem/m-p/4933929#M410478</link>
      <description>You can change ksh to bash to do that job.&lt;BR /&gt;&lt;BR /&gt;ls -al a[!e]* | awk '{ print "cp "$9" /tmp" }' | bash&lt;BR /&gt;&lt;BR /&gt;It will just work as a sub process to execute those copy operations. &lt;BR /&gt;&lt;BR /&gt;ls -al a[!e]* | awk '{ print "cp "$9" /tmp" }'&lt;BR /&gt;&lt;BR /&gt;will print the shell command that has to be executed. | bash will execute it.&lt;BR /&gt;&lt;BR /&gt;hth.</description>
      <pubDate>Mon, 17 Oct 2005 02:03:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-problem/m-p/4933929#M410478</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2005-10-17T02:03:40Z</dc:date>
    </item>
    <item>
      <title>Re: script problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-problem/m-p/4933930#M410479</link>
      <description>thanks all for the reply</description>
      <pubDate>Mon, 17 Oct 2005 02:03:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-problem/m-p/4933930#M410479</guid>
      <dc:creator>Hari Prasad S R</dc:creator>
      <dc:date>2005-10-17T02:03:44Z</dc:date>
    </item>
    <item>
      <title>Re: script problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-problem/m-p/4933931#M410480</link>
      <description>Hi Hari Prasad,&lt;BR /&gt;&lt;BR /&gt;Hope you got the solution. &lt;BR /&gt;&lt;BR /&gt;I have a serious comment as,&lt;BR /&gt;&lt;BR /&gt; I have assigned points to   1  of   63  responses to  my questions. from your profile.&lt;BR /&gt;&lt;BR /&gt;You assigned only one point to all these responses. Plz assign points to all responses so that you will get good responses.&lt;BR /&gt;&lt;BR /&gt;Every one is sharing their valuable technical time with you PROMPTLY.&lt;BR /&gt;&lt;BR /&gt;hth.</description>
      <pubDate>Mon, 17 Oct 2005 02:08:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-problem/m-p/4933931#M410480</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2005-10-17T02:08:24Z</dc:date>
    </item>
  </channel>
</rss>

