Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.os.linux.misc > #56513 > unrolled thread

tar problem

Started bydb <dieterhansbritz@gmail.com>
First post2024-06-09 14:36 +0000
Last post2024-06-14 22:02 +0200
Articles 17 on this page of 37 — 13 participants

Back to article view | Back to comp.os.linux.misc


Contents

  tar problem db <dieterhansbritz@gmail.com> - 2024-06-09 14:36 +0000
    Re: tar problem Marco Moock <mm+usenet-es@dorfdsl.de> - 2024-06-09 17:28 +0200
    Re: tar problem Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2024-06-09 16:01 +0000
    Re: tar problem Richard Kettlewell <invalid@invalid.invalid> - 2024-06-09 18:22 +0100
      Re: tar problem Robert Heller <heller@deepsoft.com> - 2024-06-09 19:12 +0000
        Re: tar problem db <dieterhansbritz@gmail.com> - 2024-06-10 11:34 +0000
          Re: tar problem Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2024-06-10 12:35 +0000
            Re: tar problem "Carlos E. R." <robin_listas@es.invalid> - 2024-06-10 23:00 +0200
              Re: tar problem Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2024-06-10 22:35 +0000
                Re: tar problem "Carlos E. R." <robin_listas@es.invalid> - 2024-06-11 00:55 +0200
                  Re: tar problem db <dieterhansbritz@gmail.com> - 2024-06-11 08:39 +0000
                    Re: tar problem Rich <rich@example.invalid> - 2024-06-11 17:07 +0000
                      Re: tar problem Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2024-06-11 18:36 +0000
                      Re: tar problem db <dieterhansbritz@gmail.com> - 2024-06-12 12:38 +0000
                        Re: tar problem Ralf Fassel <ralfixx@gmx.de> - 2024-06-12 18:49 +0200
                          Re: tar problem Richard Kettlewell <invalid@invalid.invalid> - 2024-06-12 20:16 +0100
                            Re: tar problem Robert Heller <heller@deepsoft.com> - 2024-06-12 21:08 +0000
                              Re: tar problem Richard Kettlewell <invalid@invalid.invalid> - 2024-06-13 08:33 +0100
                            Re: tar problem Ralf Fassel <ralfixx@gmx.de> - 2024-06-13 10:50 +0200
                            Re: tar problem "Carlos E. R." <robin_listas@es.invalid> - 2024-06-13 20:00 +0200
        Re: tar problem candycanearter07 <candycanearter07@candycanearter07.nomail.afraid> - 2024-06-12 06:45 +0000
    Re: tar problem Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2024-06-10 22:56 +0000
      Re: tar problem "Carlos E. R." <robin_listas@es.invalid> - 2024-06-11 02:42 +0200
      Re: tar problem db <dieterhansbritz@gmail.com> - 2024-06-12 12:41 +0000
    Re: tar problem nobody@nowhere.invalid (Marc Olschok) - 2024-06-12 15:29 +0000
      Re: tar problem Robert Heller <heller@deepsoft.com> - 2024-06-12 18:21 +0000
    Re: tar problem marrgol <marrgol@address.invalid> - 2024-06-12 19:33 +0200
    Re: tar problem db <dieterhansbritz@gmail.com> - 2024-06-14 14:35 +0000
      Re: tar problem Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2024-06-14 14:38 +0000
        Path and/or alias finding "Carlos E.R." <robin_listas@es.invalid> - 2024-06-14 19:42 +0200
          Re: Path and/or alias finding Robert Heller <heller@deepsoft.com> - 2024-06-14 18:50 +0000
            Re: Path and/or alias finding "Carlos E.R." <robin_listas@es.invalid> - 2024-06-14 21:59 +0200
            Re: Path and/or alias finding Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2024-06-14 20:24 +0000
              Re: Path and/or alias finding Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2024-06-14 20:30 +0000
              Re: Path and/or alias finding "Carlos E.R." <robin_listas@es.invalid> - 2024-06-14 22:43 +0200
          Re: Path and/or alias finding John-Paul Stewart <jpstewart@personalprojects.net> - 2024-06-14 15:30 -0400
            Re: Path and/or alias finding "Carlos E.R." <robin_listas@es.invalid> - 2024-06-14 22:02 +0200

Page 2 of 2 — ← Prev page 1 [2]


#56536

Fromcandycanearter07 <candycanearter07@candycanearter07.nomail.afraid>
Date2024-06-12 06:45 +0000
Message-ID<slrnv6igo5.13pi.candycanearter07@candydeb.host.invalid>
In reply to#56517
Robert Heller <heller@deepsoft.com> wrote at 19:12 this Sunday (GMT):
> 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.

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 <candycane> is generated from /dev/urandom

[toc] | [prev] | [next] | [standalone]


#56524

FromLew Pitcher <lew.pitcher@digitalfreehold.ca>
Date2024-06-10 22:56 +0000
Message-ID<v480bn$etuo$3@dont-email.me>
In reply to#56513
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"

[toc] | [prev] | [next] | [standalone]


#56525

From"Carlos E. R." <robin_listas@es.invalid>
Date2024-06-11 02:42 +0200
Message-ID<lcpkrrF3bnqU4@mid.individual.net>
In reply to#56524
On 2024-06-11 00:56, Lew Pitcher wrote:
> 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.

AFAIR, SuSE had it quite long ago. Probably an alias.

There is a dir command, though :-)

...

-- 
Cheers,
        Carlos E.R.

[toc] | [prev] | [next] | [standalone]


#56545

Fromdb <dieterhansbritz@gmail.com>
Date2024-06-12 12:41 +0000
Message-ID<v4c522$1ld54$3@dont-email.me>
In reply to#56524
On Mon, 10 Jun 2024 22:56:55 -0000 (UTC), Lew Pitcher wrote:

> 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?

del is an alias for rm -i, saving me that onerous -i {;]
bash, under Kubuntu
No alias set for tar or tarx

-- 
db

[toc] | [prev] | [next] | [standalone]


#56547

Fromnobody@nowhere.invalid (Marc Olschok)
Date2024-06-12 15:29 +0000
Message-ID<v4cetl$1huma$1@solani.org>
In reply to#56513
On Sun, 09 Jun 2024 16:36:49 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.

This is not really adressing your original question, but
since you want to make life easy, did you consider to have
tarx as alias for 'tar -xf' instead of a shell-script?

Also I wonder if the version of tar you are using really
recognizes gzipped files and inserts the -z option even
if it is not invoked with it.

-- 
M.O.

[toc] | [prev] | [next] | [standalone]


#56553

FromRobert Heller <heller@deepsoft.com>
Date2024-06-12 18:21 +0000
Message-ID<zsGdnc8RV5m6evT7nZ2dnZfqnPadnZ2d@giganews.com>
In reply to#56547
At Wed, 12 Jun 2024 15:29:57 -0000 (UTC) nobody@nowhere.invalid (Marc Olschok) wrote:

> 
> On Sun, 09 Jun 2024 16:36:49 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.
> 
> This is not really adressing your original question, but
> since you want to make life easy, did you consider to have
> tarx as alias for 'tar -xf' instead of a shell-script?
> 
> Also I wonder if the version of tar you are using really
> recognizes gzipped files and inserts the -z option even
> if it is not invoked with it.

Generally, tar under Linux is Gnu Tar, which does recognize compressed tar 
files, but generally only doublely extensioned filenames (eg mumble.tar.gz or 
mumble.tar.bz2, etc.)

> 

-- 
Robert Heller             -- Cell: 413-658-7953 GV: 978-633-5364
Deepwoods Software        -- Custom Software Services
http://www.deepsoft.com/  -- Linux Administration Services
heller@deepsoft.com       -- Webhosting Services
                                                                                    

[toc] | [prev] | [next] | [standalone]


#56551

Frommarrgol <marrgol@address.invalid>
Date2024-06-12 19:33 +0200
Message-ID<v4cm5d$1o2u1$1@dont-email.me>
In reply to#56513
On 2024-06-09 at 16:36 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
> ~/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/ ?

Does it work if you specify the full path of the executable in ~/bin/,
i.e. '/home/db/bin/tarx test'?
If it does, what do 'type -a tarx' and 'hash -t tarx' commands return?

[toc] | [prev] | [next] | [standalone]


#56579

Fromdb <dieterhansbritz@gmail.com>
Date2024-06-14 14:35 +0000
Message-ID<v4hkem$2u4k0$1@dont-email.me>
In reply to#56513
On Sun, 9 Jun 2024 14:36:49 -0000 (UTC), 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 ~/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/ ?

Red face time.
I just found out that I have an alias called tarx in
my .bashrc. In fact, someone asked me about this and
I answered in the negative, without checking. My apologies!

-- 
db

[toc] | [prev] | [next] | [standalone]


#56580

FromLew Pitcher <lew.pitcher@digitalfreehold.ca>
Date2024-06-14 14:38 +0000
Message-ID<v4hkle$2ta7j$1@dont-email.me>
In reply to#56579
On Fri, 14 Jun 2024 14:35:02 +0000, db wrote:

> On Sun, 9 Jun 2024 14:36:49 -0000 (UTC), 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.
[snip]
>> Why doesn't it work from bin/ ?
> 
> Red face time.
> I just found out that I have an alias called tarx in
> my .bashrc. In fact, someone asked me about this and
> I answered in the negative, without checking. My apologies!

Apology accepted. :-)

Glad you found (and presumably fixed) your problem.

-- 
Lew Pitcher
"In Skills We Trust"

[toc] | [prev] | [next] | [standalone]


#56581 — Path and/or alias finding

From"Carlos E.R." <robin_listas@es.invalid>
Date2024-06-14 19:42 +0200
SubjectPath and/or alias finding
Message-ID<g1cujkxqt4.ln2@Telcontar.valinor>
In reply to#56580
On 2024-06-14 16:38, Lew Pitcher wrote:
> On Fri, 14 Jun 2024 14:35:02 +0000, db wrote:
> 
>> On Sun, 9 Jun 2024 14:36:49 -0000 (UTC), 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.
> [snip]
>>> Why doesn't it work from bin/ ?
>>
>> Red face time.
>> I just found out that I have an alias called tarx in
>> my .bashrc. In fact, someone asked me about this and
>> I answered in the negative, without checking. My apologies!
> 
> Apology accepted. :-)
> 
> Glad you found (and presumably fixed) your problem.


What command would show what exact incantation is used? Ie, what 
path/binary, or what alias?

which tarx?


For instance:

cer@Telcontar:~> which l
which: no l in 
(/home/cer/bin:/usr/local/bin:/usr/bin:/bin:/opt/kde3/bin:/usr/lib/mit/bin:/usr/lib/mit/sbin:/usr/sbin:/usr/sbin)
cer@Telcontar:~>


But it is an alias in my system



-- 
Cheers, Carlos.

[toc] | [prev] | [next] | [standalone]


#56582 — Re: Path and/or alias finding

FromRobert Heller <heller@deepsoft.com>
Date2024-06-14 18:50 +0000
SubjectRe: Path and/or alias finding
Message-ID<m1qdnct0DMZHDfH7nZ2dnZfqn_idnZ2d@giganews.com>
In reply to#56581
At Fri, 14 Jun 2024 19:42:40 +0200 "Carlos E.R." <robin_listas@es.invalid> wrote:

> 
> On 2024-06-14 16:38, Lew Pitcher wrote:
> > On Fri, 14 Jun 2024 14:35:02 +0000, db wrote:
> > 
> >> On Sun, 9 Jun 2024 14:36:49 -0000 (UTC), 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.
> > [snip]
> >>> Why doesn't it work from bin/ ?
> >>
> >> Red face time.
> >> I just found out that I have an alias called tarx in
> >> my .bashrc. In fact, someone asked me about this and
> >> I answered in the negative, without checking. My apologies!
> > 
> > Apology accepted. :-)
> > 
> > Glad you found (and presumably fixed) your problem.
> 
> 
> What command would show what exact incantation is used? Ie, what 
> path/binary, or what alias?
> 
> which tarx?
> 
> 
> For instance:
> 
> cer@Telcontar:~> which l
> which: no l in 
> (/home/cer/bin:/usr/local/bin:/usr/bin:/bin:/opt/kde3/bin:/usr/lib/mit/bin:/usr/lib/mit/sbin:/usr/sbin:/usr/sbin)
> cer@Telcontar:~>
> 
> 
> But it is an alias in my system

This depends on the shell...

marchhare% which dir
dir:     aliased to ls -F -C
marchhare% echo $SHELL
/bin/tcsh

> 
> 
> 

-- 
Robert Heller             -- Cell: 413-658-7953 GV: 978-633-5364
Deepwoods Software        -- Custom Software Services
http://www.deepsoft.com/  -- Linux Administration Services
heller@deepsoft.com       -- Webhosting Services
                                                          

[toc] | [prev] | [next] | [standalone]


#56584 — Re: Path and/or alias finding

From"Carlos E.R." <robin_listas@es.invalid>
Date2024-06-14 21:59 +0200
SubjectRe: Path and/or alias finding
Message-ID<n1kujkxtrb.ln2@Telcontar.valinor>
In reply to#56582
On 2024-06-14 20:50, Robert Heller wrote:
> At Fri, 14 Jun 2024 19:42:40 +0200 "Carlos E.R." <robin_listas@es.invalid> wrote:


>> What command would show what exact incantation is used? Ie, what
>> path/binary, or what alias?
>>
>> which tarx?
>>
>>
>> For instance:
>>
>> cer@Telcontar:~> which l
>> which: no l in
>> (/home/cer/bin:/usr/local/bin:/usr/bin:/bin:/opt/kde3/bin:/usr/lib/mit/bin:/usr/lib/mit/sbin:/usr/sbin:/usr/sbin)
>> cer@Telcontar:~>
>>
>>
>> But it is an alias in my system
> 
> This depends on the shell...

The default bash :-)

> 
> marchhare% which dir
> dir:     aliased to ls -F -C
> marchhare% echo $SHELL
> /bin/tcsh

Interesting.

-- 
Cheers, Carlos.

[toc] | [prev] | [next] | [standalone]


#56586 — Re: Path and/or alias finding

FromLew Pitcher <lew.pitcher@digitalfreehold.ca>
Date2024-06-14 20:24 +0000
SubjectRe: Path and/or alias finding
Message-ID<v4i8ul$2ta7j$2@dont-email.me>
In reply to#56582
On Fri, 14 Jun 2024 18:50:02 +0000, Robert Heller wrote:

> At Fri, 14 Jun 2024 19:42:40 +0200 "Carlos E.R." <robin_listas@es.invalid> wrote:
> 
>> 
>> On 2024-06-14 16:38, Lew Pitcher wrote:
>> > On Fri, 14 Jun 2024 14:35:02 +0000, db wrote:
>> > 
>> >> On Sun, 9 Jun 2024 14:36:49 -0000 (UTC), 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.
>> > [snip]
>> >>> Why doesn't it work from bin/ ?
>> >>
>> >> Red face time.
>> >> I just found out that I have an alias called tarx in
>> >> my .bashrc. In fact, someone asked me about this and
>> >> I answered in the negative, without checking. My apologies!
>> > 
>> > Apology accepted. :-)
>> > 
>> > Glad you found (and presumably fixed) your problem.
>> 
>> 
>> What command would show what exact incantation is used? Ie, what 
>> path/binary, or what alias?
>> 
>> which tarx?
[snip]
>> But it is an alias in my system
> 
> This depends on the shell...
> 
> marchhare% which dir
> dir:     aliased to ls -F -C
> marchhare% echo $SHELL
> /bin/tcsh

16:22:25 $ echo $SHELL
/bin/bash

16:22:28 $ alias
alias tarx='tar -xf'

bash(1) says 
  "Aliases are created and listed with the alias command,
   and removed with the unalias command."

-- 
Lew Pitcher
"In Skills We Trust"

[toc] | [prev] | [next] | [standalone]


#56587 — Re: Path and/or alias finding

FromLew Pitcher <lew.pitcher@digitalfreehold.ca>
Date2024-06-14 20:30 +0000
SubjectRe: Path and/or alias finding
Message-ID<v4i98q$2ta7j$3@dont-email.me>
In reply to#56586
On Fri, 14 Jun 2024 20:24:53 +0000, Lew Pitcher wrote:

> On Fri, 14 Jun 2024 18:50:02 +0000, Robert Heller wrote:
> 
>> At Fri, 14 Jun 2024 19:42:40 +0200 "Carlos E.R." <robin_listas@es.invalid> wrote:
>> 
>>> 
>>> On 2024-06-14 16:38, Lew Pitcher wrote:
>>> > On Fri, 14 Jun 2024 14:35:02 +0000, db wrote:
>>> > 
>>> >> On Sun, 9 Jun 2024 14:36:49 -0000 (UTC), 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.
>>> > [snip]
>>> >>> Why doesn't it work from bin/ ?
>>> >>
>>> >> Red face time.
>>> >> I just found out that I have an alias called tarx in
>>> >> my .bashrc. In fact, someone asked me about this and
>>> >> I answered in the negative, without checking. My apologies!
>>> > 
>>> > Apology accepted. :-)
>>> > 
>>> > Glad you found (and presumably fixed) your problem.
>>> 
>>> 
>>> What command would show what exact incantation is used? Ie, what 
>>> path/binary, or what alias?
>>> 
>>> which tarx?
> [snip]
>>> But it is an alias in my system
>> 
>> This depends on the shell...
>> 
>> marchhare% which dir
>> dir:     aliased to ls -F -C
>> marchhare% echo $SHELL
>> /bin/tcsh
> 
> 16:22:25 $ echo $SHELL
> /bin/bash
> 
> 16:22:28 $ alias
> alias tarx='tar -xf'
> 
> bash(1) says 
>   "Aliases are created and listed with the alias command,
>    and removed with the unalias command."

POSIX says
  "A valid alias name shall be one that has been defined by
   the alias utility and not subsequently undefined using
   unalias."
   (https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_03_01)
and further says (in regard to the alias utility)
  "The alias utility shall create or redefine alias definitions
   or write the values of existing alias definitions to standard
   output."
   (https://pubs.opengroup.org/onlinepubs/9699919799/utilities/alias.html)

So, it appears that bash conforms to POSIX requirements with
respect to the behaviour of it's "alias" builtin command.
 



-- 
Lew Pitcher
"In Skills We Trust"

[toc] | [prev] | [next] | [standalone]


#56588 — Re: Path and/or alias finding

From"Carlos E.R." <robin_listas@es.invalid>
Date2024-06-14 22:43 +0200
SubjectRe: Path and/or alias finding
Message-ID<qjmujkx5ae.ln2@Telcontar.valinor>
In reply to#56586
On 2024-06-14 22:24, Lew Pitcher wrote:
> On Fri, 14 Jun 2024 18:50:02 +0000, Robert Heller wrote:
> 
>> At Fri, 14 Jun 2024 19:42:40 +0200 "Carlos E.R." <robin_listas@es.invalid> wrote:

...

>>> What command would show what exact incantation is used? Ie, what
>>> path/binary, or what alias?
>>>
>>> which tarx?
> [snip]
>>> But it is an alias in my system
>>
>> This depends on the shell...
>>
>> marchhare% which dir
>> dir:     aliased to ls -F -C
>> marchhare% echo $SHELL
>> /bin/tcsh
> 
> 16:22:25 $ echo $SHELL
> /bin/bash
> 
> 16:22:28 $ alias
> alias tarx='tar -xf'

Yes, this confirms that it is an alias, but the question was rather how 
to find that a particular incantation by the user runs what.

is it (tarx or whatever) a command in some path, or is it an alias? 
"type" does that.


-- 
Cheers, Carlos.

[toc] | [prev] | [next] | [standalone]


#56583 — Re: Path and/or alias finding

FromJohn-Paul Stewart <jpstewart@personalprojects.net>
Date2024-06-14 15:30 -0400
SubjectRe: Path and/or alias finding
Message-ID<ld3k2rFihpjU1@mid.individual.net>
In reply to#56581
On 2024-06-14 1:42 p.m., Carlos E.R. wrote:
> 
> What command would show what exact incantation is used? Ie, what
> path/binary, or what alias?
> 
> which tarx?

If you're using Bash as your shell, the 'type' builtin command will tell
you.  E.g.,

$ type ls
ls is aliased to `ls --color=auto'

[toc] | [prev] | [next] | [standalone]


#56585 — Re: Path and/or alias finding

From"Carlos E.R." <robin_listas@es.invalid>
Date2024-06-14 22:02 +0200
SubjectRe: Path and/or alias finding
Message-ID<p6kujkxtrb.ln2@Telcontar.valinor>
In reply to#56583
On 2024-06-14 21:30, John-Paul Stewart wrote:
> On 2024-06-14 1:42 p.m., Carlos E.R. wrote:
>>
>> What command would show what exact incantation is used? Ie, what
>> path/binary, or what alias?
>>
>> which tarx?
> 
> If you're using Bash as your shell, the 'type' builtin command will tell
> you.  E.g.,
> 
> $ type ls
> ls is aliased to `ls --color=auto'
> 

Ah, yes. I knew about "type", but I don't use it. I will now.


cer@Telcontar:~> type l
l is aliased to `ls -alF'
cer@Telcontar:~> type ls
ls is aliased to `_ls'
cer@Telcontar:~> type _ls
_ls is a function
_ls ()
{
     local IFS=' ';
     command ls $LS_OPTIONS ${1+"$@"}
}
cer@Telcontar:~>
cer@Telcontar:~> echo $LS_OPTIONS
-N --color=tty -T 0
cer@Telcontar:~>



-- 
Cheers, Carlos.

[toc] | [prev] | [standalone]


Page 2 of 2 — ← Prev page 1 [2]

Back to top | Article view | comp.os.linux.misc


csiph-web