I have a requirement to extract tar files residing in another directory to current directory, instead of copying tar files from the source to current directory, extracting tar files, and deleting tar files.
Here’s a shell script to do this. Did not think about including change directory in the shell script until now.
#!/bin/sh -x pax -rv -f /home/mdinh/fbo_ggs_Solaris_sparc_ora11g_64bit.tar -s ',^/,,' pax -rv -f /home/mdinh/ggs_FileWriter_Solaris_sparc_v11_1_1_0_0_007.tar -s ',^/,,' exit
The tar files reside on NFS which is mounted on every server I want to extract to.
Why do it this way? I am a lazy DBA.
Note: tested on Solaris 10
Reference: