PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Serveur - Sécurité et techniques > comp.unix.shell > How to autocomplete in shell
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
comp.unix.shell Using and programming the Unix shell.

How to autocomplete in shell

Réponse
 
LinkBack Outils de la discussion
Vieux 05/11/2007, 23h24   #1
parag_paul@hotmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut How to autocomplete in shell

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

  Réponse avec citation
Vieux 06/11/2007, 04h38   #2
rthangam
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: How to autocomplete in shell

On Nov 6, 4:24 am, "parag_p...@hotmail.com" <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.

  Réponse avec citation
Vieux 06/11/2007, 04h50   #3
Troy Piggins
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: How to autocomplete in shell

* rthangam is quoted
* & my replies are inline below :
> On Nov 6, 4:24 am, "parag_p...@hotmail.com" <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
  Réponse avec citation
Vieux 06/11/2007, 09h28   #4
rthangam
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: How to autocomplete in shell

On Nov 6, 9:50 am, Troy Piggins <usenet-0...@piggo.com> wrote:
> * rthangam is quoted
> * & my replies are inline below :
>
> > On Nov 6, 4:24 am, "parag_p...@hotmail.com" <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

  Réponse avec citation
Vieux 06/11/2007, 17h58   #5
rthangam
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: How to autocomplete in shell

On Nov 6, 9:50 am, Troy Piggins <usenet-0...@piggo.com> wrote:
> * rthangam is quoted
> * & my replies are inline below :
>
> > On Nov 6, 4:24 am, "parag_p...@hotmail.com" <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.

  Réponse avec citation
Vieux 06/11/2007, 18h54   #6
parag_paul@hotmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: How to autocomplete in shell

On Nov 6, 9:58 am, rthangam <ramesh.thangam...@gmail.com> wrote:
> On Nov 6, 9:50 am, Troy Piggins <usenet-0...@piggo.com> wrote:
>
>
>
> > * rthangam is quoted
> > * & my replies are inline below :

>
> > > On Nov 6, 4:24 am, "parag_p...@hotmail.com" <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]

  Réponse avec citation
Vieux 06/11/2007, 21h40   #7
Troy Piggins
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: How to autocomplete in shell

* parag_paul@hotmail.com is quoted
* & my replies are inline below :
> On Nov 6, 9:58 am, rthangam <ramesh.thangam...@gmail.com> wrote:
>> On Nov 6, 9:50 am, Troy Piggins <usenet-0...@piggo.com> wrote:
>>
>> > * rthangam is quoted
>> > * & my replies are inline below :

>>
>> > > On Nov 6, 4:24 am, "parag_p...@hotmail.com" <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
  Réponse avec citation
Vieux 06/11/2007, 22h30   #8
Chris F.A. Johnson
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: How to autocomplete in shell

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 <http://cfaj.freeshell.org/shell/>
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
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 02h42.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 1,58026 seconds with 16 queries