How to autocomplete in shell

How to autocomplete in shell

am 06.11.2007 00:24:57 von parag_paul

I have been trying to do some unsetenv s

Now some of the variables are pretty long. How do we get around this

IS there any way to auto complete any non ambiguous start of a
variable in the nev
-Parag

Re: How to autocomplete in shell

am 06.11.2007 05:38:43 von ramesh.thangamani

On Nov 6, 4:24 am, "parag_p...@hotmail.com"
wrote:
> I have been trying to do some unsetenv s
>
> Now some of the variables are pretty long. How do we get around this
>
> IS there any way to auto complete any non ambiguous start of a
> variable in the nev
> -Parag

I don't think we have any for expanding environment variables.

Re: How to autocomplete in shell

am 06.11.2007 05:50:40 von Troy Piggins

* rthangam is quoted
* & my replies are inline below :
> On Nov 6, 4:24 am, "parag_p...@hotmail.com"
> wrote:
>> I have been trying to do some unsetenv s
>>
>> Now some of the variables are pretty long. How do we get around this
>>
>> IS there any way to auto complete any non ambiguous start of a
>> variable in the nev
>> -Parag
>
> I don't think we have any for expanding environment variables.

My Ubuntu Gutsy does, and Dapper did before that.
bash-complete is the package name.

I hit:

$ echo $PAT[tab]

and it autocompletes to

$ echo $PATH

successfully.

--
Troy Piggins | http://piggo.com/~troy
RLU#415538 ,-O (o- O
O ) //\ O
`-O V_/_ OOO

Re: How to autocomplete in shell

am 06.11.2007 10:28:41 von ramesh.thangamani

On Nov 6, 9:50 am, Troy Piggins wrote:
> * rthangam is quoted
> * & my replies are inline below :
>
> > On Nov 6, 4:24 am, "parag_p...@hotmail.com"
> > wrote:
> >> I have been trying to do some unsetenv s
>
> >> Now some of the variables are pretty long. How do we get around this
>
> >> IS there any way to auto complete any non ambiguous start of a
> >> variable in the nev
> >> -Parag
>
> > I don't think we have any for expanding environment variables.
>
> My Ubuntu Gutsy does, and Dapper did before that.
> bash-complete is the package name.
>
> I hit:
>
> $ echo $PAT[tab]
>
> and it autocompletes to
>
> $ echo $PATH
>
> successfully.
>
> --
> Troy Piggins |http://piggo.com/~troy
> RLU#415538 ,-O (o- O
> O ) //\ O
> `-O V_/_ OOO

Sorry for my reply, as Troy pointed out it works fine if you give tab
after "$". I tested
in tcsh shell ( Red hat Linux ). It works fine

Re: How to autocomplete in shell

am 06.11.2007 18:58:55 von ramesh.thangamani

On Nov 6, 9:50 am, Troy Piggins wrote:
> * rthangam is quoted
> * & my replies are inline below :
>
> > On Nov 6, 4:24 am, "parag_p...@hotmail.com"
> > wrote:
> >> I have been trying to do some unsetenv s
>
> >> Now some of the variables are pretty long. How do we get around this
>
> >> IS there any way to auto complete any non ambiguous start of a
> >> variable in the nev
> >> -Parag
>
> > I don't think we have any for expanding environment variables.
>
> My Ubuntu Gutsy does, and Dapper did before that.
> bash-complete is the package name.
>
> I hit:
>
> $ echo $PAT[tab]
>
> and it autocompletes to
>
> $ echo $PATH
>
> successfully.
>
> --
> Troy Piggins |http://piggo.com/~troy
> RLU#415538 ,-O (o- O
> O ) //\ O
> `-O V_/_ OOO

Oops sorry for my reply. Like Troy pointed out it is working for
environment variables also
it works fine in tcsh shell of Linux.

Re: How to autocomplete in shell

am 06.11.2007 19:54:34 von parag_paul

On Nov 6, 9:58 am, rthangam wrote:
> On Nov 6, 9:50 am, Troy Piggins wrote:
>
>
>
> > * rthangam is quoted
> > * & my replies are inline below :
>
> > > On Nov 6, 4:24 am, "parag_p...@hotmail.com"
> > > wrote:
> > >> I have been trying to do some unsetenv s
>
> > >> Now some of the variables are pretty long. How do we get around this
>
> > >> IS there any way to auto complete any non ambiguous start of a
> > >> variable in the nev
> > >> -Parag
>
> > > I don't think we have any for expanding environment variables.
>
> > My Ubuntu Gutsy does, and Dapper did before that.
> > bash-complete is the package name.
>
> > I hit:
>
> > $ echo $PAT[tab]
>
> > and it autocompletes to
>
> > $ echo $PATH
>
> > successfully.
>
> > --
> > Troy Piggins |http://piggo.com/~troy
> > RLU#415538 ,-O (o- O
> > O ) //\ O
> > `-O V_/_ OOO
>
> Oops sorry for my reply. Like Troy pointed out it is working for
> environment variables also
> it works fine in tcsh shell of Linux.

But nothing for the autocomplete of unsetenvs , coz, we cannot do
unsetenv $FO[tab]

Re: How to autocomplete in shell

am 06.11.2007 22:40:54 von Troy Piggins

* parag_paul@hotmail.com is quoted
* & my replies are inline below :
> On Nov 6, 9:58 am, rthangam wrote:
>> On Nov 6, 9:50 am, Troy Piggins wrote:
>>
>> > * rthangam is quoted
>> > * & my replies are inline below :
>>
>> > > On Nov 6, 4:24 am, "parag_p...@hotmail.com"
>> > > wrote:
>> > >> I have been trying to do some unsetenv s
>>
>> > >> Now some of the variables are pretty long. How do we get around this
>>
>> > >> IS there any way to auto complete any non ambiguous start of a
>> > >> variable in the nev
>> > >> -Parag
>>
>> > > I don't think we have any for expanding environment variables.
>>
>> > My Ubuntu Gutsy does, and Dapper did before that.
>> > bash-complete is the package name.
>>
>> > I hit:
>>
>> > $ echo $PAT[tab]
>>
>> > and it autocompletes to
>>
>> > $ echo $PATH
>>
>> > successfully.
>>
>> Oops sorry for my reply. Like Troy pointed out it is working for
>> environment variables also
>> it works fine in tcsh shell of Linux.
>
> But nothing for the autocomplete of unsetenvs , coz, we cannot do
> unsetenv $FO[tab]

I don't have the unsetenv command, but if I try

$ unset PAT[tab]

it works. It is autocompleting what the command would actually
be. eg 'echo' expects variables in the form $PATH, while 'unset'
expects just PATH. Not sure what unsetenv takes as args. And of
course the variables must exist and be set. What is the output
of

$ echo $FO_whatever_the_variable_name_is

--
Troy Piggins | http://piggo.com/~troy
RLU#415538 ,-O (o- O
O ) //\ O
`-O V_/_ OOO

Re: How to autocomplete in shell

am 06.11.2007 23:30:31 von cfajohnson

On 2007-11-05, parag_paul@hotmail.com wrote:
>
>
> I have been trying to do some unsetenv s
>
> Now some of the variables are pretty long. How do we get around this
>
> IS there any way to auto complete any non ambiguous start of a
> variable in the nev

If you are using bash, just press tab, as for other forms of
completion.

--
Chris F.A. Johnson, author
Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)
===== My code in this post, if any, assumes the POSIX locale
===== and is released under the GNU General Public Licence