Untar'ing and changing directory
Posted on 2009-05-11
Ok, this is a dumb problem I know. However it can be solved, sweet. I have a tarball that is downloaded as part of a script, there is only one directory in the tar file. I need to change into that directory and do some stuff with the files in there, problem is, sometimes the directory name changes, and I dont konw what it will be (its actually a revision hash from git). Is there a way to untar a file and then immediately go into the directory it creates? Or is there a good way in bash to untar, look at the last folder created in the current directory and change into it?