The ultimate goal here is to write a script that can take a tarball containing source code in some language and parse the files to extract dependency information and then check whether those dependencies are in the tarball or not.I'm wondering if there's some combination of arguments you can give supply to tar that will allow you to write to stdout the contents of a file at a particular path inside the tarball.$ echo aaaa > a$ echo bbbb > b$ tar cvf foo.tar a ba ab b$ tar tf foo.tarabI want to be able to do something like$ tar <some arguments> <path to tarball> <path to file within tarball>In this specific case...$ tar <some arguments> foo.tar aand have it write aaaa to stdout and fail informatively if there is no file inside the tarball associated with that path.Does tar have the ability to do this?
Write file contents associated with path inside tar archive to stdout
tar