开发者

shell script to extract tar file please help

开发者 https://www.devze.com 2023-03-18 00:32 出处:网络
I have created a shell script (.sh) to extract a tar file. Below is the code: tar -xvwf 1.0.1.tar But when the script runs and start to extracting the tar, it asks confirmation in each file extract

I have created a shell script (.sh) to extract a tar file. Below is the code:

tar -xvwf 1.0.1.tar

But when the script runs and start to extracting the tar, it asks confirmation in each file extract.

extract `1.0.1'?

How can I avoid that in my script? I'm running on Linux开发者_开发百科.


Just tar xvf 1.0.1.tar should do the trick; the -w options means "ask for confirmation for every action" (tar(1)).


Remove the -w option, which specifically asks it to confirm on every file. From the tar man page:

 -w, --interactive, --confirmation
       ask for confirmation for every action
0

精彩评论

暂无评论...
验证码 换一张
取 消