<?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 writting in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/script-writting/m-p/3964163#M27474</link>
    <description>You may have to drop the final xargs.&lt;BR /&gt;It combines multiple arguments for one operation. That's fine for 'rm' but tricky for 'mv'.&lt;BR /&gt;&lt;BR /&gt;Just replace the 'mv' with 'echo' and see in clear print what you were about to ask the system to do! &lt;BR /&gt;&lt;BR /&gt;Hein.&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Mon, 19 Mar 2007 22:49:43 GMT</pubDate>
    <dc:creator>Hein van den Heuvel</dc:creator>
    <dc:date>2007-03-19T22:49:43Z</dc:date>
    <item>
      <title>Script writting</title>
      <link>https://community.hpe.com/t5/operating-system-linux/script-writting/m-p/3964157#M27468</link>
      <description>There are some files under the path /tmp , if I want to remove all the files which contains the word "testing" , what can I do ? thx</description>
      <pubDate>Mon, 19 Mar 2007 04:50:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/script-writting/m-p/3964157#M27468</guid>
      <dc:creator>hangyu</dc:creator>
      <dc:date>2007-03-19T04:50:54Z</dc:date>
    </item>
    <item>
      <title>Re: Script writting</title>
      <link>https://community.hpe.com/t5/operating-system-linux/script-writting/m-p/3964158#M27469</link>
      <description>Try:&lt;BR /&gt;&lt;BR /&gt;#find . -type f |xargs grep test|awk -F ":" '{print $1}' |uniq &lt;BR /&gt;&lt;BR /&gt;to see if files are matched correctly , then &lt;BR /&gt;&lt;BR /&gt;#find . -type f |xargs grep test|awk -F ":" '{print $1}' |uniq |xargs rm&lt;BR /&gt;</description>
      <pubDate>Mon, 19 Mar 2007 05:09:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/script-writting/m-p/3964158#M27469</guid>
      <dc:creator>Jarle Bjorgeengen</dc:creator>
      <dc:date>2007-03-19T05:09:25Z</dc:date>
    </item>
    <item>
      <title>Re: Script writting</title>
      <link>https://community.hpe.com/t5/operating-system-linux/script-writting/m-p/3964159#M27470</link>
      <description>s/find ./find /tmp/g</description>
      <pubDate>Mon, 19 Mar 2007 05:10:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/script-writting/m-p/3964159#M27470</guid>
      <dc:creator>Jarle Bjorgeengen</dc:creator>
      <dc:date>2007-03-19T05:10:07Z</dc:date>
    </item>
    <item>
      <title>Re: Script writting</title>
      <link>https://community.hpe.com/t5/operating-system-linux/script-writting/m-p/3964160#M27471</link>
      <description>thx reply ,&lt;BR /&gt;&lt;BR /&gt;it is strange that I try it in two machines , one is perfectly work , but another machine can only show the word "testing" in the result ( what I need is the file name not the word I search ) , can advise what is wrong in this machine ? thx&lt;BR /&gt;&lt;BR /&gt;$find . -type f -maxdepth 1  |xargs grep testing|awk -F ":" '{print $1}' |uniq &lt;BR /&gt;testing</description>
      <pubDate>Mon, 19 Mar 2007 20:34:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/script-writting/m-p/3964160#M27471</guid>
      <dc:creator>hangyu</dc:creator>
      <dc:date>2007-03-19T20:34:27Z</dc:date>
    </item>
    <item>
      <title>Re: Script writting</title>
      <link>https://community.hpe.com/t5/operating-system-linux/script-writting/m-p/3964161#M27472</link>
      <description>Well, if that find on one machine, only finds 1 file, then grep will by default NOT output the filename ebfore each match, just show the match.&lt;BR /&gt;On the other machine there must have been more than one matches for the find, and xargs gives more than 1 input file to grep, and grep then knows it needs to tell you which file gave the match.&lt;BR /&gt;&lt;BR /&gt;You can force this using: grep -H for --with-filename&lt;BR /&gt;&lt;BR /&gt;(on my version of grep. Check with grep --help)&lt;BR /&gt;&lt;BR /&gt;hth,&lt;BR /&gt;Hein van den Heuvel&lt;BR /&gt;</description>
      <pubDate>Mon, 19 Mar 2007 21:11:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/script-writting/m-p/3964161#M27472</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2007-03-19T21:11:06Z</dc:date>
    </item>
    <item>
      <title>Re: Script writting</title>
      <link>https://community.hpe.com/t5/operating-system-linux/script-writting/m-p/3964162#M27473</link>
      <description>thx Hein van den ,&lt;BR /&gt;&lt;BR /&gt;It works fine now after add -H , I still have a question , if I want to move it to another directory , I try &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;find . -type f -maxdepth 1 |xargs grep testing|awk -F ":" '{print $1}' |uniq |xargs mv /tmp/ora , it is not work , can advise what is wrong ? thx &lt;BR /&gt;&lt;BR /&gt;mv: cannot overwrite non-directory `./abc' with directory `/tmp/ora/'</description>
      <pubDate>Mon, 19 Mar 2007 21:59:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/script-writting/m-p/3964162#M27473</guid>
      <dc:creator>hangyu</dc:creator>
      <dc:date>2007-03-19T21:59:43Z</dc:date>
    </item>
    <item>
      <title>Re: Script writting</title>
      <link>https://community.hpe.com/t5/operating-system-linux/script-writting/m-p/3964163#M27474</link>
      <description>You may have to drop the final xargs.&lt;BR /&gt;It combines multiple arguments for one operation. That's fine for 'rm' but tricky for 'mv'.&lt;BR /&gt;&lt;BR /&gt;Just replace the 'mv' with 'echo' and see in clear print what you were about to ask the system to do! &lt;BR /&gt;&lt;BR /&gt;Hein.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 19 Mar 2007 22:49:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/script-writting/m-p/3964163#M27474</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2007-03-19T22:49:43Z</dc:date>
    </item>
    <item>
      <title>Re: Script writting</title>
      <link>https://community.hpe.com/t5/operating-system-linux/script-writting/m-p/3964164#M27475</link>
      <description>thx Hein van den ,&lt;BR /&gt;&lt;BR /&gt;I am not too understand , can advise what I need to do ? thx</description>
      <pubDate>Mon, 19 Mar 2007 23:06:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/script-writting/m-p/3964164#M27475</guid>
      <dc:creator>hangyu</dc:creator>
      <dc:date>2007-03-19T23:06:23Z</dc:date>
    </item>
    <item>
      <title>Re: Script writting</title>
      <link>https://community.hpe.com/t5/operating-system-linux/script-writting/m-p/3964165#M27476</link>
      <description>Thx reply ,&lt;BR /&gt;&lt;BR /&gt;I have solved it , thx much for help.</description>
      <pubDate>Tue, 20 Mar 2007 04:16:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/script-writting/m-p/3964165#M27476</guid>
      <dc:creator>hangyu</dc:creator>
      <dc:date>2007-03-20T04:16:49Z</dc:date>
    </item>
    <item>
      <title>Re: Script writting</title>
      <link>https://community.hpe.com/t5/operating-system-linux/script-writting/m-p/3964166#M27477</link>
      <description>&lt;!--!*#--&gt;Why not use 'find' for almost-everything?&lt;BR /&gt;&lt;BR /&gt;find /tmp -type f -exec grep "testing" {} \; -exec mv {} /other/path/ \;&lt;BR /&gt;&lt;BR /&gt;Same format can be used for the 'rm'.</description>
      <pubDate>Tue, 20 Mar 2007 17:03:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/script-writting/m-p/3964166#M27477</guid>
      <dc:creator>Stuart Browne</dc:creator>
      <dc:date>2007-03-20T17:03:58Z</dc:date>
    </item>
    <item>
      <title>Re: Script writting</title>
      <link>https://community.hpe.com/t5/operating-system-linux/script-writting/m-p/3964167#M27478</link>
      <description>Oh, and if you don't want to see the grep 'testing' output for every match, use 'grep -q "testing" {}'..&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;(0pts pls)</description>
      <pubDate>Tue, 20 Mar 2007 17:04:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/script-writting/m-p/3964167#M27478</guid>
      <dc:creator>Stuart Browne</dc:creator>
      <dc:date>2007-03-20T17:04:47Z</dc:date>
    </item>
    <item>
      <title>Re: Script writting</title>
      <link>https://community.hpe.com/t5/operating-system-linux/script-writting/m-p/3964168#M27479</link>
      <description>thx all.</description>
      <pubDate>Wed, 21 Mar 2007 03:57:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/script-writting/m-p/3964168#M27479</guid>
      <dc:creator>hangyu</dc:creator>
      <dc:date>2007-03-21T03:57:49Z</dc:date>
    </item>
    <item>
      <title>Re: Script writting</title>
      <link>https://community.hpe.com/t5/operating-system-linux/script-writting/m-p/3964169#M27480</link>
      <description>How can i use find with tar command. and in case i want to tar files for one particular date how can i do that.</description>
      <pubDate>Wed, 21 Mar 2007 14:38:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/script-writting/m-p/3964169#M27480</guid>
      <dc:creator>Om prakash_1</dc:creator>
      <dc:date>2007-03-21T14:38:21Z</dc:date>
    </item>
    <item>
      <title>Re: Script writting</title>
      <link>https://community.hpe.com/t5/operating-system-linux/script-writting/m-p/3964170#M27481</link>
      <description>Om, please start a new thread.&lt;BR /&gt;&lt;BR /&gt;Short answer: Look at '-T -'.</description>
      <pubDate>Wed, 21 Mar 2007 17:58:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/script-writting/m-p/3964170#M27481</guid>
      <dc:creator>Stuart Browne</dc:creator>
      <dc:date>2007-03-21T17:58:32Z</dc:date>
    </item>
  </channel>
</rss>

