1834808 Members
2424 Online
110070 Solutions
New Discussion

Re: cpio ??

 
Amit Dixit_2
Regular Advisor

cpio ??

Hi
I am having a script like this

install_informix_dir=/opt/install_informix_dir
informix_dir=/opt/informix

Now it executes a tar command to extract
informix tar

tar xf

and then

mkdir $informix_dir
cd $informix_dir

Then it is having these 2 cpio command, please explain what this is doing

cpio -icdBum < $informix_install_dir/informix/server/ids.cpi > /dev/null 2>&1

cpio -icdBum < $informix_install_dir/informix/iconnect/hp/connect.cpi > /dev/null 2>&1


What are the above 2 CPIO command doing please explain.....

Thanks,
Amit
5 REPLIES 5
Todd McDaniel_1
Honored Contributor

Re: cpio ??

Looks like you are cping files to the dir you just made and want to see errors goin to STDOUT from STDERR...
Unix, the other white meat.
Muthukumar_5
Honored Contributor

Re: cpio ??

Hai,

You are coping the ids.cpi and connect.cpi files to pwd directory with the same directory path. It will use the read / write headers in ASCII format.

cpio is using the method of extraction of files from the standard input.

If you want to redirect to or from devices,we have to use B option to control the block input / output to 5120 bytes.

Old files are not replaced with the new files with it's name. It will use the same modification time as before extraction.

STDOUT messages are Redirected to null device. Error messages are redirected to STDOUT mode.

I hope B option is not needed if you are not using the devices.

Regards,
Muthukumar.
Easy to suggest when don't know about the problem!
Amit Dixit_2
Regular Advisor

Re: cpio ??

Hi,
Thanks for the reply but the script is
not doing what it is suppose to do
It doesn't create the same directory
structure and cpi's the file to them

What could be the possible reason for
this and can I display error on screen.

Thanks,
Amit
Kevin Batter_4
Advisor

Re: cpio ??

silly ?

but should the cpios be
$install_informix_dir not $informix_install_dir

Amit Dixit_2
Regular Advisor

Re: cpio ??

Hi,
That is not the mistake I typed it wrong
on ITRC but in the script there is no
mistake related to that

Please see the attached for the details
and tell me what I am doing wrong.

Thanks,
Amit