Reputation:
Im copy tar file form folder A to folder B and I want that when it finish to copy it to unzip it, I try with the following in my shell script which doesnt work,any idea?
cp /home/i557956/A/file.tar /home/i557956/B
tar -xvf /home/i557956/B/file.tar
The copy was success but the tar is not extracted in B folder...
Upvotes: 2
Views: 310
Reputation: 56432
Try to move into the B folder before extracting:
cp /home/i557956/A/file.tar /home/i557956/B
(cd /home/i557956/B/ && tar -xvf file.tar)
Upvotes: 1