Path: csiph.com!news.swapon.de!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: candycanearter07 Newsgroups: comp.os.linux.misc Subject: Re: tar problem Date: Wed, 12 Jun 2024 06:45:02 -0000 (UTC) Organization: the-candyden-of-code Lines: 58 Message-ID: References: Injection-Date: Wed, 12 Jun 2024 08:45:03 +0200 (CEST) Injection-Info: dont-email.me; posting-host="a92ee56fe71330095cf9c81c717935bf"; logging-data="1622498"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18hxRQ+Fjsft91+Nz+N907uwMhLst6X/VXAQuyUrhSA5w==" User-Agent: slrn/1.0.3 (Linux) Cancel-Lock: sha1:n/Oyfidr9Fv9xb54KYESTitHJDI= X-Face: b{dPmN&%4|lEo,wUO\"KLEOu5N_br(N2Yuc5/qcR5i>9-!^e\.Tw9?/m0}/~:UOM:Zf]% b+ V4R8q|QiU/R8\|G\WpC`-s?=)\fbtNc&=/a3a)r7xbRI]Vl)r<%PTriJ3pGpl_/B6!8pe\btzx `~R! r3.0#lHRE+^Gro0[cjsban'vZ#j7,?I/tHk{s=TFJ:H?~=]`O*~3ZX`qik`b:.gVIc-[$t/e ZrQsWJ >|l^I_[pbsIqwoz.WGA] wrote at 19:12 this Sunday (GMT): > At Sun, 09 Jun 2024 18:22:38 +0100 Richard Kettlewell wrote: > >> >> db 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. Technically, /bin is usually a symlink to /usr/bin, but still yeah never put stuff in there. > 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. I think $HOME/.local/bin is a common one too. >> >> Probably /bin/tarx isn't the same as ./tarx. What does >> cat /bin/tarx >> show? >> > -- user is generated from /dev/urandom