I was trying to write a simple perl script the other day that, when given a tar or tar.gz file, got a listing of its contents (tar -tf or tar -tzf), put that into an array, then unlinked all those files. I often get tarballs that dump into the current directory, then have to manually delete all the files. I've written the script to take a file where I redirected the output of the tar listing, and removes files from the 2nd file, but I'd like to just dump all the files from the tarball into an array, and operate off of that.
Originally posted as a Categorized Question.
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|