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
精彩评论