how to search for the alias that are set. - Linux

This is a discussion on how to search for the alias that are set. - Linux ; Hi All, I am trying to write a which like utility ie. my_which. Basic functionality is over. But, I am not sure how I could search for aliases as the standard which command does. Please give some suggestions.... Thanks and ...

+ Reply to Thread
Results 1 to 9 of 9

Thread: how to search for the alias that are set.

  1. how to search for the alias that are set.

    Hi All,

    I am trying to write a which like utility ie. my_which. Basic
    functionality is over.
    But, I am not sure how I could search for aliases as the standard which
    command does.

    Please give some suggestions....

    Thanks and regards,
    Prasad.


  2. Re: how to search for the alias that are set.

    "Prasad" writes:

    > Hi All,
    >
    > I am trying to write a which like utility ie. my_which. Basic
    > functionality is over.
    > But, I am not sure how I could search for aliases as the standard which
    > command does.
    >
    > Please give some suggestions....


    Stop trying. The shell aliases are impossible to determine outside
    the shell.

    --
    Måns Rullgård
    mru@inprovide.com

  3. Re: how to search for the alias that are set.

    In article <1168448782.620572.218070@k58g2000hse.googlegroups. com>,
    Prasad wrote:

    >But, I am not sure how I could search for aliases as the standard which
    >command does.
    >
    >Please give some suggestions....


    Ah, have you considered reading the which source?


  4. Re: how to search for the alias that are set.

    In article ,
    Måns Rullgård wrote:

    >Stop trying. The shell aliases are impossible to determine outside
    >the shell.


    Try typing "which which"


  5. Re: how to search for the alias that are set.

    ellis@no.spam () writes:

    > In article ,
    > Måns Rullgård wrote:
    >
    >>Stop trying. The shell aliases are impossible to determine outside
    >>the shell.

    >
    > Try typing "which which"


    What's your point? The "which" executable knows nothing about shell
    aliases. Many shells have a builtin "which" that does.

    --
    Måns Rullgård
    mru@inprovide.com

  6. Re: how to search for the alias that are set.

    In article ,
    Måns Rullgård wrote:

    >> Try typing "which which"


    >What's your point? The "which" executable knows nothing about shell
    >aliases. Many shells have a builtin "which" that does.


    Did you try it?


  7. Re: how to search for the alias that are set.

    ellis@no.spam () writes:

    > In article ,
    > Måns Rullgård wrote:
    >
    >>> Try typing "which which"

    >
    >>What's your point? The "which" executable knows nothing about shell
    >>aliases. Many shells have a builtin "which" that does.

    >
    > Did you try it?


    Yes, I did:

    $ which which
    /usr/bin/which

    Am I supposed to be surprised? I don't see the connection with aliases.

    --
    Måns Rullgård
    mru@inprovide.com

  8. Re: how to search for the alias that are set.

    In article ,
    Måns Rullgård wrote:

    >$ which which
    >/usr/bin/which
    >
    >Am I supposed to be surprised? I don't see the connection with aliases.


    Ok, you're distribution didn't do what mine does:

    alias which='alias | /usr/bin/which --tty-only --read-alias --show-dot --show-tilde'
    /usr/bin/which

    The alias for which is probably what accounts for the OP's desire
    to find aliases.


  9. Re: how to search for the alias that are set.

    In article <1168448782.620572.218070@k58g2000hse.googlegroups. com>,
    Prasad wrote:
    :Hi All,
    :
    :I am trying to write a which like utility ie. my_which. Basic
    :functionality is over.
    :But, I am not sure how I could search for aliases as the standard which
    :command does.
    :
    :Please give some suggestions....

    $ type which
    which is aliased to `alias | /usr/bin/which --tty-only --read-alias --show-dot --show-tilde'

    --
    Bob Nichols AT comcast.net I am "RNichols42"

+ Reply to Thread