Sujet : Re: tar problem
De : heller (at) *nospam* deepsoft.com (Robert Heller)
Groupes : comp.os.linux.miscDate : 09. Jun 2024, 20:12:52
Autres entêtes
Organisation : Deepwoods Software
Message-ID : <F_OdnckCE_opY_j7nZ2dnZfqn_udnZ2d@giganews.com>
References : 1 2
User-Agent : TkNews 3.0 (1.2.17)
At Sun, 09 Jun 2024 18:22:38 +0100 Richard Kettlewell <
invalid@invalid.invalid> wrote:
db <dieterhansbritz@gmail.com> writes:
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
~/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
>
Why doesn't it work from bin/ ?
What does 'which tarx' show? Does it show /bin/tarx?
Note: you should *never* put random programs in /bin (or even /usr/bin). The
only programs/files in these directories should be ones installed by your
package management system. /bin is reserved for core / early boot programs
and others would be in /usr/bin.
Locally provided programs should be in either /usr/local/bin or /opt/bin
(depending on your file system usage philosiphy). These directories
can/should be added to your $PATH. *Personally* provided programs should be
in $HOME/bin, and this directory can be added to your $PATH as well.
Probably /bin/tarx isn't the same as ./tarx. What does
cat /bin/tarx
show?
-- Robert Heller -- Cell: 413-658-7953 GV: 978-633-5364Deepwoods Software -- Custom Software Serviceshttp://www.deepsoft.com/ -- Linux Administration Servicesheller@deepsoft.com -- Webhosting Services