Operating System - HP-UX
1751691 Members
4708 Online
108781 Solutions
New Discussion

Re: error on script to copy files

 
SOLVED
Go to solution
Dennis Handly
Acclaimed Contributor

Re: error on script to copy files

>you mean changing the #!/bin/sh by #!/bin/ksh?

 

Yes, that will do it.

(Of course there may be issues similar to HP-UX where shell scripts may have to use /sbin/sh so they work if /usr isn't mounted.)

NDO
Super Advisor

Re: error on script to copy files

After changing to ksh now I have a different error:

./transf[7]: /usr/bin/cp: arg list too long
But I believe if the shorten the markers :

touch -mt 201304240000 /var/tmp/ref1
touch -mt 201305152359 /var/tmp/ref2
I can solve this
Dennis Handly
Acclaimed Contributor
Solution

Re: error on script to copy files

>./transf[7]: /usr/bin/cp: arg list too long
>But I believe if the shorten the markers :

 

But why would you want to settle?  :-)

 

The correct solution on HP-UX and Linux would be to use: find ... -exec special-cp-script {} +

But assuming your files are large and it isn't worth trying to use xargs or write that above script, can use:

for file in $(< file_lst); do

   cp -pr $file /moneta_collected02/in_psl1/

done

NDO
Super Advisor

Re: error on script to copy files

thanks a lot, I have tried that but I am certain is going to work, thanks again for your help
Dennis Handly
Acclaimed Contributor

Re: error on script to copy files

>I have tried that but I am certain is going to work, thanks again for your help

 

Sure.

If you have performance issues, we can use the find/xargs solutions to invoke cp with multiple files.