Thinking Out Loud

May 25, 2012

Extract tar files to current directory

Filed under: solaris — mdinh @ 3:34 am

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 ',^/,,'

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


>>directing solaris tar to extract to current directory

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Create a free website or blog at

%d bloggers like this: