Operating System - HP-UX
1849281 Members
5455 Online
104042 Solutions
New Discussion

Re: hp-ux 7.0 cp command problem...

 
SOLVED
Go to solution
hakan toktas
Occasional Contributor

hp-ux 7.0 cp command problem...

cp command is quite primitive on HP-UX 7.0 and It doesn't allow me to merge into an existing directory with the same name. It has only -r option in order to copy recursively but it doesn't have -i or -f options to copy/merge into an existing directory with the same name... It simply fails to do that. Is there any command on HP-UX 7.0 to do that??? Or is there a way to upgrade only that command or a solution?

Thanks in advance
i m a test engineer and unix makes me sick!!
5 REPLIES 5
Darren Prior
Honored Contributor
Solution

Re: hp-ux 7.0 cp command problem...

Hi,

I think you will probably struggle to find any utilities for HP-UX 7 these days, it's not been around for quite a while! You may find that writing your own C program would be the best bet.

regards,

Darren.
Calm down. It's only ones and zeros...
melvyn burnard
Honored Contributor

Re: hp-ux 7.0 cp command problem...

Sorry but that OS version is SO OLD, you will not even get patches any more.
You really should look at installing a newer OS, such as HP-UX 11.00
My house is the bank's, my money the wife's, But my opinions belong to me, not HP!
Vicente Sanchez_3
Respected Contributor

Re: hp-ux 7.0 cp command problem...

Hello,

Perhaps this is a solution:

create a new cp script that simules cp:
cp

the script is like this:

if [ -f $2 ];then
echo "The file exists. Do you want to upgrade?"
read option
if [ "$option" = "S" -o "$option" = s" ];then
rm $2
cp $1 $2
fi
fi

HTH, Vicente.
hakan toktas
Occasional Contributor

Re: hp-ux 7.0 cp command problem...

Since this system has hundred thousands of lines hp-basic code, it's not possible to upgrade the system because of the backward incompatibility of hp-basic. That's why I'm trying to find another solution...

I've already written a script but I couldn't manage to execute it for the directories (it's simple as you write for the files) but I don't wanna remove contents of a directory, I wanna merge newer files on to it... (maybe I'll work on that if I can't manage to compile cp on 7.0)

I've managed to compile a newer version of cp.c on linux and it's working on linux, I'll try it on HP-UX 7.0 on monday...

Thank you very much for your assistance...

PS. I'll let you know about the result...
i m a test engineer and unix makes me sick!!
Stefan Schulz
Honored Contributor

Re: hp-ux 7.0 cp command problem...

Hi,

have you tried to use tar? Think you could tar the contens of the one directory, change to the destination and extract again. Should work in one commandline without writing a tarfile.

If this works, perhaps you can set this as an alias.

I don't have a shell at hand right now, but it could be something like:

tar -cvf - sourcedir | (cd destination; tar -xf - )

Hope this helps

Regards Stefan
No Mouse found. System halted. Press Mousebutton to continue.