Sujet : Re: tar problem
De : lew.pitcher (at) *nospam* digitalfreehold.ca (Lew Pitcher)
Groupes : comp.os.linux.miscDate : 10. Jun 2024, 23:56:55
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <v480bn$etuo$3@dont-email.me>
References : 1
User-Agent : Pan/0.139 (Sexual Chocolate; GIT bf56508 git://git.gnome.org/pan2)
On Sun, 09 Jun 2024 14:36:49 +0000, db wrote:
I like to make life easy so I wrote a one-line script
for extracting the contents of a tar file. I copied it
into the /bin directory so I can run it from anywhere.
I tried it out in a test directory where I had it, and
where there is a small test tar file. Here is the dialogue
from running it, using both the local script and the one
in /bin:
~/tartest> ls
tarx test.tar.gz
~/tartest> cat tarx
tar -xf $1.tar.gz
~/tartest> cat ~/bin/tarx
tar -xf $1.tar.gz
~/tartest> ./tarx test
~/tartest> ls
tarx test test.tar.gz
~/tartest> del -r test
Is this a homegrown command, or does your distribution supply it?
FWIW, "del" is not a standard Unix or Linux command, and (AFAIK)
does not exist as a builtin in any Unix/Linux shell.
~/tartest> tarx test
tar (child): test: Cannot open: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now
The error message implies that
a) tar can't find an input file called "test", and
b) that your tarx command doesn't expand it's argument
into a filename that tar /can/ find.
Why doesn't it work from bin/ ?
What shell do you use?
Do you have an alias set for tar or tarx?
-- Lew Pitcher"In Skills We Trust"