Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[TIP] Bash-completion
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

Goto page 1, 2, 3  Next  
Reply to topic    Gentoo Forums Forum Index Forum italiano (Italian) Risorse italiane (documentazione e tools)
View previous topic :: View next topic  
Author Message
paolo
l33t
l33t


Joined: 23 Jul 2002
Posts: 768
Location: SBT (AP)

PostPosted: Mon Aug 11, 2003 11:28 pm    Post subject: [TIP] Bash-completion Reply with quote

Koma mi ha fatto venire l'idea del tip, di metterne uno ogni tanto :)

Conoscete la bash-completion?
Il sito web è questo.

In pratica è uno script (in bash!) che potenzia la completion che già ha la bash e cioè quella feature che vi permette di "completare" la digitazione di un nome file semplicemente premendo il tasto TAB.

Con questo script avrete la completion anche con il comando "emerge" (vi completerà la sezione e il nome pacchetto, con i comandi modprobe, e tanti altri!

E' di una utilità unica.
Io la trovo indispensabile, soprattutto perchè uso quasi esclusivamente la console. Ma... chi da X non apre una, due, tre shell? :)

fate
Code:
emerge bash-completion

modificate quello che c'è da modificare (i modi per farla funzionare sono diversi) e divertitevi a sfruttare la potenza di questo tool.

ByEZz,
Paolo
_________________
Nihil sine magno labore
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 30837
Location: here

PostPosted: Mon Aug 11, 2003 11:36 pm    Post subject: Reply with quote

E la prima cosa che scarico quando ho finito di fare emerge system. E' l'utility che uso di piu' in assoluto.
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
MyZelF
Bodhisattva
Bodhisattva


Joined: 25 Feb 2003
Posts: 2010
Location: Venice, Italy

PostPosted: Tue Aug 12, 2003 3:28 am    Post subject: Reply with quote

eccezionale... ottimo tip! :)
Back to top
View user's profile Send private message
bubble27
Guru
Guru


Joined: 07 Aug 2003
Posts: 365
Location: Campobasso

PostPosted: Tue Aug 12, 2003 9:46 am    Post subject: Reply with quote

ecco a cosa si riferisce l'ultima riga del file .bashrc ..... :lol:

##uncomment the following to activate bash-completion:
#[ -f /etc/profile.d/bash-completion ] && source /etc/profile.d/bash-completion
Back to top
View user's profile Send private message
bsolar
Bodhisattva
Bodhisattva


Joined: 12 Jan 2003
Posts: 2764

PostPosted: Tue Aug 12, 2003 9:58 am    Post subject: Reply with quote

Non sarebbe più conveniente mettere tutti i TIP in una thread unica che fa da elenco con un link ad un'altra (o altre) thread per la discussione?

Lascio la palla a cerri... 8)
_________________
I may not agree with what you say, but I'll defend to the death your right to say it.
Back to top
View user's profile Send private message
cerri
Bodhisattva
Bodhisattva


Joined: 05 Mar 2003
Posts: 2957
Location: # init S

PostPosted: Tue Aug 12, 2003 10:17 am    Post subject: Reply with quote

Giuro, ci avevo pensato ma mi sono detto...
mente di cerri wrote:
naaaaaaa sarebbe bello ma se apro un altro sticky qui mi cacciano....

8)
_________________
Enjoy your freedom.
Sex is like hacking. You get in, you get out, and you hope you didnt leave something behind that can be traced back to you.
<----------------------->
Andrea Cerrito
Back to top
View user's profile Send private message
xlyz
Veteran
Veteran


Joined: 27 Oct 2002
Posts: 1470
Location: Italy

PostPosted: Tue Aug 12, 2003 10:29 am    Post subject: Reply with quote

cerri wrote:
Giuro, ci avevo pensato ma mi sono detto...
mente di cerri wrote:
naaaaaaa sarebbe bello ma se apro un altro sticky qui mi cacciano....

8)

anche perchè non vorrei dover scrollare tutta la pagina per arrivare ai post non sticky :twisted:
Back to top
View user's profile Send private message
shev
Bodhisattva
Bodhisattva


Joined: 03 Feb 2003
Posts: 4084
Location: Italy

PostPosted: Thu Aug 14, 2003 11:21 am    Post subject: Reply with quote

Ottimo il tips di Paolo.
Ricordo che sul sito gentoo.it raccogliamo nella sezione Tips&Tricks cose del genere, quindi oltre che a mettere giustamente il tutto in un topic apposito in questo forum, se qualche volenteroso volesse scrivere brevi howto anche per il sito sarebbe una gran cosa (io ovviamente sono disponibile, però mi pare giusto che ognuno metta a suo nome i suoi tips & tricks).
Back to top
View user's profile Send private message
Rotterdam
n00b
n00b


Joined: 14 Nov 2003
Posts: 22
Location: Core Dump

PostPosted: Fri Nov 14, 2003 9:18 am    Post subject: Reply with quote

ma una volta emergiato e decomentata la riga nel .bashrc cosa bisogna fare?
_________________
Core Dump
Back to top
View user's profile Send private message
micron
Guru
Guru


Joined: 23 Jul 2003
Posts: 411
Location: Bergamo, Italy

PostPosted: Fri Nov 14, 2003 9:24 am    Post subject: Reply with quote

Mitico!! corro a provarlo, grande tip!! 8)
_________________
~ "Progress is merely a realisation of utopias" ~
Back to top
View user's profile Send private message
possi
n00b
n00b


Joined: 07 Nov 2003
Posts: 26

PostPosted: Wed Sep 01, 2004 1:58 am    Post subject: Reply with quote

Rotterdam wrote:
ma una volta emergiato e decomentata la riga nel .bashrc cosa bisogna fare?


premere il TAB :wink:
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 30837
Location: here

PostPosted: Wed Sep 01, 2004 5:15 am    Post subject: Reply with quote

possi wrote:
Rotterdam wrote:
ma una volta emergiato e decomentata la riga nel .bashrc cosa bisogna fare?


premere il TAB :wink:

Hai visto la data del messaggio di Rotterdam :D
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
possi
n00b
n00b


Joined: 07 Nov 2003
Posts: 26

PostPosted: Wed Sep 01, 2004 10:28 am    Post subject: Reply with quote

fedeliallalinea wrote:
possi wrote:
Rotterdam wrote:
ma una volta emergiato e decomentata la riga nel .bashrc cosa bisogna fare?


premere il TAB :wink:

Hai visto la data del messaggio di Rotterdam :D


hemmm... :D
Back to top
View user's profile Send private message
mambro
l33t
l33t


Joined: 22 Mar 2004
Posts: 752
Location: Mira (VE) - Italy

PostPosted: Sun Oct 03, 2004 9:23 pm    Post subject: Reply with quote

Meglio tardi che mai :lol:
Cmq a me funziona da utente ma da root non va... ho copiato il .bashrc che ho nella mia home in /root/.bashrc ma pare che root nn carichi quel file :? Cosa sbaglio?
_________________
"The design of a worldwide, fully transparent distributed file system for simultaneous use by millions of mobile and frequently disconnected users is left as an excercise for the reader".
Andrew S. Tanenbaum, Distributed Operating Systems.
Back to top
View user's profile Send private message
gutter
Bodhisattva
Bodhisattva


Joined: 13 Mar 2004
Posts: 7162
Location: Aarau, Aargau, Switzerland

PostPosted: Sun Oct 03, 2004 9:25 pm    Post subject: Reply with quote

mambro wrote:
Meglio tardi che mai :lol:
Cmq a me funziona da utente ma da root non va... ho copiato il .bashrc che ho nella mia home in /root/.bashrc ma pare che root nn carichi quel file :? Cosa sbaglio?


Copia anche il /etc/skel/.bash_profile in /root e riprova vedrai che funge.
_________________
Registered as User #281564 and Machines #163761
Back to top
View user's profile Send private message
n3m0
l33t
l33t


Joined: 08 Feb 2004
Posts: 798
Location: Richville, Naples, Italy, Europe

PostPosted: Sun Oct 03, 2004 9:45 pm    Post subject: Reply with quote

E' del file /etc/inputrc che mi dite? :)
Non so come sia fatto quello di default di gentoo, perche' la prima cosa che ho fatto quandoi ho installato gentoo è mettere la MIA copia di inputrc, gentilmente concesso da SuSE (me lo porto dietro dai tempi in cui provai SuSE 8 ).

Con il seguente inputrc, aggiungere nuove funzionalita' alla bash, come la comodissima history prefix based (ma anche altre, a voi il piacere di scropirle)

Es:

Code:

# mpla <PG_UP>
# mplayer pippo.avi <PG_UP>
# mplayer pluto.avi


e così via...

Se questo inputrc risulta essere un tip (nel senso che quello di default di Gentoo non permette queste operazioni) allora ditemelo che lo metto in un topic a parte.

Ecco il file.

Code:
################################################################################
## /etc/inputrc
##
## Attempt to put different TERMs together in one readline init file.
## Copyright (c) 1997,2000 SuSE Linux AG, Nuernberg, Germany.
##
## Author: Werner Fink,  <werner@suse.de>
##
################################################################################
#
# Eight bit compatible: Umlaute
#
set meta-flag on
set output-meta on
set convert-meta off
set term xy
#
# VI line editing
#
$if mode=vi
set editing-mode vi
set keymap vi
$endif
#
# Common standard keypad and cursor
#
"\e[1~": beginning-of-line
"\e[2~": yank
"\e[3~": delete-char
"\e[4~": end-of-line
"\e[5~": history-search-backward
"\e[6~": history-search-forward
$if term=xterm
"\e[2;5~": yank
"\e[3;5~": delete-char
"\e[5;5~": history-search-backward
"\e[6;5~": history-search-forward
$endif
"\e[C":  forward-char
"\e[D":  backward-char
"\e[A":  previous-history
"\e[B":  next-history
$if term=xterm
"\e[E":  re-read-init-file
$else
"\e[G":  re-read-init-file
$endif
#
# Avoid network problems
#   ... \177 (ASCII-DEL) and \010 (ASCII-BS)
#       do `backward-delete-char'
# Note: `delete-char' is maped to \033[3~
#       Therefore xterm's responce on pressing
#       key Delete or KP-Delete should be
#       \033[3~ ... NOT \177
#
"\C-?":  backward-delete-char
"\C-H":  backward-delete-char
#
# Home and End
#
$if term=xterm
#
# Normal keypad and cursor of xterm
#
"\e[1~":   history-search-backward
"\e[4~":   set-mark
"\e[H":      beginning-of-line
"\e[F":      end-of-line
# Home and End of application keypad and cursor of xterm
"\eOH":      beginning-of-line
"\eOF":      end-of-line
"\eO5H":   beginning-of-line
"\eO5F":   end-of-line
$else
$if term=kvt
"\e[1~":   history-search-backward
"\e[4~":   set-mark
"\eOH":      beginning-of-line
"\eOF":      end-of-line
$endif
#
# TERM=linux or console or gnome
#
"\e[1~":   beginning-of-line
"\e[4~":   end-of-line
$endif
#
# Application keypad and cursor of xterm
#
$if term=xterm
"\eOD":         backward-char
"\eOC":         forward-char
"\eOA":         previous-history
"\eOB":         next-history
"\eOE":         re-read-init-file
# DEC keyboard KP_F1 - KP_F4 or
# XTerm of XFree86 in VT220 mode F1 - F4
"\eOP":      prefix-meta
"\eOQ":      undo
"\eOR":      "" 
"\eOS":      kill-line
$endif
$if term=gnome
# or gnome terminal F1 - F4
"\eOP":      prefix-meta
"\eOQ":      undo
"\eOR":      ""
"\eOS":      kill-line
$endif
#
# Function keys F1 - F12
#
$if term=linux
#
# On console the first five function keys
#
"\e[[A":   prefix-meta
"\e[[B":   undo
"\e[[C":   ""
"\e[[D":   kill-line
"\e[[E":   ""
$else
#
# The first five standard function keys
#
"\e[11~":   prefix-meta
"\e[12~":   undo
"\e[13~":   ""
"\e[14~":   kill-line
"\e[15~":   ""
$endif
"\e[17~":   ""
"\e[18~":   ""
"\e[19~":   ""
"\e[20~":   ""
"\e[21~":   ""
# Note: F11, F12 are identical with Shift_F1 and Shift_F2
"\e[23~":   ""
"\e[24~":   ""
#
# Shift Function keys F1  - F12
#      identical with F11 - F22
#
#"\e[23~":   ""
#"\e[24~":   ""
"\e[25~":   ""
"\e[26~":   ""
# DEC keyboard: F15=\e[28~ is Help
"\e[28~":   ""
# DEC keyboard: F16=\e[29~ is Menu
"\e[29~":   ""
"\e[31~":   ""
"\e[32~":   ""
"\e[33~":   ""
"\e[34~":   ""
$if term=xterm
# Not common
"\e[35~":   ""
"\e[36~":   ""
$endif
#
$if term=xterm
#
# Application keypad and cursor of xterm
# with NumLock ON
#
# Operators
"\eOo":      "/"
"\eOj":      "*"
"\eOm":      "-"
"\eOk":      "+"
"\eOl":      ","
"\eOM":      accept-line
"\eOn":      "."
# Numbers
"\eOp":      "0"
"\eOq":      "1"
"\eOr":      "2"
"\eOs":      "3"
"\eOt":      "4"
"\eOu":      "5"
"\eOv":      "6"
"\eOw":      "7"
"\eOx":      "8"
"\eOy":      "9"
$endif
#
#  EMACS line editing
#
$if mode=emacs
#
# ... xterm application cursor
#
$if term=xterm
"\e\eOD":   backward-word
"\e\eOC":   forward-word
"\e\eOA":   up-history
"\e\eOB":   down-history
"\C-\eOD":   backward-char
"\C-\eOC":   forward-char
"\C-\eOA":   up-history
"\C-\eOB":   down-history
$endif
#
# Standard cursor
#
"\e\e[D":   backward-word
"\e\e[C":   forward-word
"\e\e[A": up-history
"\e\e[B": down-history
"\C-\e[D": backward-char
"\C-\e[C": forward-char
"\C-\e[A":   up-history
"\C-\e[B":   down-history
$endif
#
# end
#

_________________
L’energia è la civiltà. Lasciarla in mano ai piromani/petrolieri è criminale. Perché aspettare che finisca il petrolio?
L’età della pietra non è mica finita per mancanza di pietre. - B.G.


Site/Blog: http://www.neminis.org
Back to top
View user's profile Send private message
mambro
l33t
l33t


Joined: 22 Mar 2004
Posts: 752
Location: Mira (VE) - Italy

PostPosted: Mon Oct 04, 2004 12:28 pm    Post subject: Reply with quote

gutter wrote:
mambro wrote:
Meglio tardi che mai :lol:
Cmq a me funziona da utente ma da root non va... ho copiato il .bashrc che ho nella mia home in /root/.bashrc ma pare che root nn carichi quel file :? Cosa sbaglio?


Copia anche il /etc/skel/.bash_profile in /root e riprova vedrai che funge.


Ora va, grazie mille :wink:
_________________
"The design of a worldwide, fully transparent distributed file system for simultaneous use by millions of mobile and frequently disconnected users is left as an excercise for the reader".
Andrew S. Tanenbaum, Distributed Operating Systems.
Back to top
View user's profile Send private message
gutter
Bodhisattva
Bodhisattva


Joined: 13 Mar 2004
Posts: 7162
Location: Aarau, Aargau, Switzerland

PostPosted: Mon Oct 04, 2004 1:38 pm    Post subject: Reply with quote

mambro wrote:

Ora va, grazie mille :wink:


Di niente :wink:
_________________
Registered as User #281564 and Machines #163761
Back to top
View user's profile Send private message
xoen
Guru
Guru


Joined: 06 Sep 2003
Posts: 472
Location: /dev/null

PostPosted: Sun Nov 28, 2004 9:03 am    Post subject: Re: [TIP] Bash-completion Reply with quote

paolo wrote:
Con questo script avrete la completion anche con il comando "emerge" (vi completerà la sezione e il nome pacchetto, con i comandi modprobe, e tanti altri!

Deng Iu...
_________________
xoen.Blog()
god@paradise # tar xfvjp big-bang.tar.bz2 -C universe
Back to top
View user's profile Send private message
SilverXXX
l33t
l33t


Joined: 18 Sep 2004
Posts: 885

PostPosted: Sun Nov 28, 2004 9:33 am    Post subject: Reply with quote

fantastico 8O ! Cosa mi ero perso, finora.
_________________
about:mozilla
Back to top
View user's profile Send private message
lavish
Bodhisattva
Bodhisattva


Joined: 13 Sep 2004
Posts: 4296

PostPosted: Sun Nov 28, 2004 10:16 am    Post subject: Reply with quote

wowowowow! MITTICO! E io che nn ne sapevo ancora nulla... :!:
_________________
minimalblue.com | secgroup.github.io/
Back to top
View user's profile Send private message
Giepi
Apprentice
Apprentice


Joined: 29 Sep 2004
Posts: 164
Location: Non pallo, io!

PostPosted: Tue Nov 30, 2004 2:51 pm    Post subject: Reply with quote

non riesco attivarlo su root.

non esiste /root/.bashrc e /etc/skel è vuota
se in /root/bashrc metto solo la stringa che da sul sito o quella che me la fa girare nel mio utente "normale" non va the same
_________________
I SEE THE FLASH! THE FLAAASH!
AND YOU INFEDEL WILL DIE!!!
SLEEEPEEER AWAAAKEE!!!
* allucinato *
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 30837
Location: here

PostPosted: Tue Nov 30, 2004 2:52 pm    Post subject: Reply with quote

Io metto la riga in /etc/profile
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
gutter
Bodhisattva
Bodhisattva


Joined: 13 Mar 2004
Posts: 7162
Location: Aarau, Aargau, Switzerland

PostPosted: Tue Nov 30, 2004 3:35 pm    Post subject: Reply with quote

fedeliallalinea wrote:
Io metto la riga in /etc/profile


@Giepi: Almeno così la setti pet tutti e ti togli il pensiero :wink:
_________________
Registered as User #281564 and Machines #163761
Back to top
View user's profile Send private message
stefanonafets
l33t
l33t


Joined: 10 Feb 2003
Posts: 644

PostPosted: Tue Nov 30, 2004 3:59 pm    Post subject: Reply with quote

Quote:
wowowowow! MITTICO! E io che nn ne sapevo ancora nulla...


Su non-mi-ricordo-quale guida c'era scritta una roba del tipo "Bash ha un casino di parti oscure, e la gente tende ad usarle tutte..."

(scusate per la simil-citazione abbastanza imprecisa, spero che qualcuno possa correggere e/o migliorare...)
_________________
registered Linux user number #411324
sed 's/ke/che/g'

<The Deployment Slave is initializing>
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Forum italiano (Italian) Risorse italiane (documentazione e tools) All times are GMT
Goto page 1, 2, 3  Next
Page 1 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum