Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I was trying to set up a script to download and untar some sources in a build script, but for some maddening reason tar seems to have gone insane, where it constantly attempts to do something with some long-gone folder.

Initially I was attempting to

curl -L http://www.example.com/tehcodez.tar.gz | tar -C assets -xz

And I got a confusing error...so I stripped it way down to tar x (which shouldn't really do anything, but at least not die like it does), I get the truly inexplicable error:

nick@cody:~/Projects/Website/
$ tar x
tar: ~/Projects/Tape-Worms/: Cannot open: No such file or directory
tar: Error is not recoverable: exiting now

...Tape-Worms is some old project I was working on (and the folder no longer exists), and I have no idea how tar is a) pulling that path out of thin air, then b) choking on it. It doesn't matter what folder I'm in, /, ~, I get the exact same error.

share|improve this question
add comment

1 Answer 1

up vote 1 down vote accepted

tar apparently uses the variable TAPE as a default file path, and I had it set to the offending ~/Projects/Tape-Worms/ in my .bashrc for a shortcut. Naturally.

ENVIRONMENT
     The behavior of tar is controlled by the following environment variables, among 
     others:

     TAPE    Device or file to use for the archive if --file is not specified.  If 
             this environment variable is unset, use stdin or stdout instead.

So:

$ unset TAPE
$ tar x
^C
$
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.