<?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: Arguments too long in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/arguments-too-long/m-p/4611408#M620449</link>
    <description>for i in /export1/uw/ECM/images/BGIR2093*.txt&lt;BR /&gt;do&lt;BR /&gt;cp $i /export1/uw/ECM/backup/images&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Or &lt;BR /&gt;ls /export1/uw/ECM/images/BGIR2093*.txt | xargs -i -t cp {} /export1/uw/ECM/backup/images&lt;BR /&gt;</description>
    <pubDate>Fri, 02 Apr 2010 07:26:46 GMT</pubDate>
    <dc:creator>Laurent Menase</dc:creator>
    <dc:date>2010-04-02T07:26:46Z</dc:date>
    <item>
      <title>Arguments too long</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/arguments-too-long/m-p/4611407#M620448</link>
      <description>Hi there,&lt;BR /&gt;&lt;BR /&gt;Apparently I keep recieve an error message when I try to copy some files to other directory.&lt;BR /&gt;&lt;BR /&gt;/% cp /export1/uw/ECM/images/BGIR2093*.txt /export1/uw/ECM/backup/images&lt;BR /&gt;Arguments too long.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Please assist.</description>
      <pubDate>Fri, 02 Apr 2010 03:10:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/arguments-too-long/m-p/4611407#M620448</guid>
      <dc:creator>LawrenceLow</dc:creator>
      <dc:date>2010-04-02T03:10:21Z</dc:date>
    </item>
    <item>
      <title>Re: Arguments too long</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/arguments-too-long/m-p/4611408#M620449</link>
      <description>for i in /export1/uw/ECM/images/BGIR2093*.txt&lt;BR /&gt;do&lt;BR /&gt;cp $i /export1/uw/ECM/backup/images&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Or &lt;BR /&gt;ls /export1/uw/ECM/images/BGIR2093*.txt | xargs -i -t cp {} /export1/uw/ECM/backup/images&lt;BR /&gt;</description>
      <pubDate>Fri, 02 Apr 2010 07:26:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/arguments-too-long/m-p/4611408#M620449</guid>
      <dc:creator>Laurent Menase</dc:creator>
      <dc:date>2010-04-02T07:26:46Z</dc:date>
    </item>
    <item>
      <title>Re: Arguments too long</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/arguments-too-long/m-p/4611409#M620450</link>
      <description>&amp;gt; for i in /export1/uw/ECM/images/BGIR2093*.txt&lt;BR /&gt;&lt;BR /&gt;This "for" command line has the same risk of being too long after wildcard expansion as the original cp command.&lt;BR /&gt;&lt;BR /&gt;The trick is to use "find" and pass any necessary wildcards to it in quotes, so they won't be expanded by the shell.&lt;BR /&gt;&lt;BR /&gt;But the "find" command looks into sub-directories too, so you should verify it does what you want before actually making it do anything that's difficult to undo:&lt;BR /&gt;&lt;BR /&gt;find /export1/uw/ECM/images -name 'BGIR2093*.txt' -exec echo cp {} /export1/uw/ECM/backup/images/ \+&lt;BR /&gt;&lt;BR /&gt;This should display a list of (probably very long) "cp" commands. If the commands look OK, just remove the "echo" in the middle and the cp commands will be actually executed, instead of displayed.&lt;BR /&gt;&lt;BR /&gt;Limiting "find" to a single directory in a portable way may be tricky:&lt;BR /&gt;&lt;A href="http://www.in-ulm.de/~mascheck/various/find/" target="_blank"&gt;http://www.in-ulm.de/~mascheck/various/find/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;MK</description>
      <pubDate>Fri, 02 Apr 2010 08:15:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/arguments-too-long/m-p/4611409#M620450</guid>
      <dc:creator>Matti_Kurkela</dc:creator>
      <dc:date>2010-04-02T08:15:05Z</dc:date>
    </item>
    <item>
      <title>Re: Arguments too long</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/arguments-too-long/m-p/4611410#M620451</link>
      <description>&amp;gt;Matti: -exec echo cp {} /export1/uw/ECM/backup/images/ \+&lt;BR /&gt;&lt;BR /&gt;Unfortunately you can't use {} with + except last.  You'll need to create a script that reverses the first parm with the last:&lt;BR /&gt;find ... -exec cp_reverse /export1/uw/ECM/backup/images/ {} +&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;target=$1&lt;BR /&gt;shift&lt;BR /&gt;cp "$@" "$target"&lt;BR /&gt;&lt;BR /&gt;&amp;gt;Laurent: ls /export1/uw/ECM/images/BGIR2093*.txt | xargs&lt;BR /&gt;&lt;BR /&gt;This will also fail.  You need to add add grep to the pipeline and you would have to cd to that directory:&lt;BR /&gt;cd /export1/uw/ECM/images&lt;BR /&gt;ls | grep "\.txt$" | xargs ...&lt;BR /&gt;&lt;BR /&gt;Also if you cd to the directory, you may be able to use:&lt;BR /&gt;cp BGIR2093*.txt /export1/uw/ECM/backup/images</description>
      <pubDate>Fri, 02 Apr 2010 09:18:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/arguments-too-long/m-p/4611410#M620451</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2010-04-02T09:18:18Z</dc:date>
    </item>
  </channel>
</rss>

