Гость
Форумы / Unix-системы [игнор отключен] [закрыт для гостей] / Bash completion / 7 сообщений из 7, страница 1 из 1
14.08.2017, 09:24
    #39504765
Bauer
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Bash completion
Всем привет.

Код: sql
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
45.
46.
47.
48.
49.
50.
51.
52.
53.
54.
55.
56.
57.
58.
59.
60.
61.
62.
63.
64.
65.
66.
67.
68.
69.
70.
71.
72.
73.
74.
75.
76.
77.
78.
79.
80.
81.
[oracle@ucsstnd2 ~]$ uname -a
Linux ucsstnd2 2.6.32-642.el6.x86_64 #1 SMP Wed Apr 13 00:51:26 EDT 2016 x86_64 x86_64 x86_64 GNU/Linux
[oracle@ucsstnd2 ~]$ set
BASH=/bin/bash
BASHOPTS=checkwinsize:cmdhist:expand_aliases:extquote:force_fignore:hostcomplete:interactive_comments:login_shell:progcomp:promptvars:sourcepath
BASH_ALIASES=()
BASH_ARGC=()
BASH_ARGV=()
BASH_CMDS=()
BASH_LINENO=()
BASH_SOURCE=()
BASH_VERSINFO=([0]="4" [1]="1" [2]="2" [3]="1" [4]="release" [5]="x86_64-redhat-linux-gnu")
BASH_VERSION='4.1.2(1)-release'
IFS=$' \t\n'
LANG=en_US.UTF-8
LESSOPEN='||/usr/bin/lesspipe.sh %s'
LINES=64
LOGNAME=oracle
MACHTYPE=x86_64-redhat-linux-gnu
MAIL=/var/spool/mail/oracle
MAILCHECK=60
OPTERR=1
OPTIND=1
PIPESTATUS=([0]="0")
PPID=30587
PROMPT_COMMAND='printf "\033]0;%s@%s:%s\007" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/~}"'
PS1='[\u@\h \W]\$ '
PS2='> '
PS4='+ '
SHELL=/bin/bash
SHELLOPTS=braceexpand:emacs:hashall:histexpand:history:interactive-comments:monitor
SHLVL=1
TERM=xterm
TMP=/tmp
TMPDIR=/tmp
_=-a
colors=/etc/DIR_COLORS
__udisks ()
{
    local IFS='
';
    local cur="${COMP_WORDS[COMP_CWORD]}";
    if [ "${COMP_WORDS[$(($COMP_CWORD - 1))]}" = "--show-info" ]; then
        COMPREPLY=($(compgen -W "$(udisks --enumerate-device-files)" -- $cur));
    else
        if [ "${COMP_WORDS[$(($COMP_CWORD - 1))]}" = "--inhibit-polling" ]; then
            COMPREPLY=($(compgen -W "$(udisks --enumerate-device-files)" -- $cur));
        else
            if [ "${COMP_WORDS[$(($COMP_CWORD - 1))]}" = "--mount" ]; then
                COMPREPLY=($(compgen -W "$(udisks --enumerate-device-files)" -- $cur));
            else
                if [ "${COMP_WORDS[$(($COMP_CWORD - 1))]}" = "--unmount" ]; then
                    COMPREPLY=($(compgen -W "$(udisks --enumerate-device-files)" -- $cur));
                else
                    if [ "${COMP_WORDS[$(($COMP_CWORD - 1))]}" = "--detach" ]; then
                        COMPREPLY=($(compgen -W "$(udisks --enumerate-device-files)" -- $cur));
                    else
                        if [ "${COMP_WORDS[$(($COMP_CWORD - 1))]}" = "--ata-smart-refresh" ]; then
                            COMPREPLY=($(compgen -W "$(udisks --enumerate-device-files)" -- $cur));
                        else
                            if [ "${COMP_WORDS[$(($COMP_CWORD - 1))]}" = "--ata-smart-simulate" ]; then
                                _filedir || return 0;
                            else
                                if [ "${COMP_WORDS[$(($COMP_CWORD - 1))]}" = "--set-spindown" ]; then
                                    COMPREPLY=($(compgen -W "$(udisks --enumerate-device-files)" -- $cur));
                                else
                                    if [ "${COMP_WORDS[$(($COMP_CWORD - 1))]}" = "--poll-for-media" ]; then
                                        COMPREPLY=($(compgen -W "$(udisks --enumerate-device-files)" -- $cur));
                                    else
                                        COMPREPLY=($(IFS=: compgen -W "--dump:--inhibit-polling:--inhibit-all-polling:--enumerate:--enumerate-device-files:--monitor:--monitor-detail:--show-info:--help:--mount:--mount-fstype:--mount-options:--unmount:--unmount-options:--detach:--detach-options:--ata-smart-refresh:--ata-smart-wakeup:--ata-smart-simulate:--set-spindown:--set-spindown-all:--spindown-timeout:--poll-for-media" -- $cur));
                                    fi;
                                fi;
                            fi;
                        fi;
                    fi;
                fi;
            fi;
        fi;
    fi
}
[oracle@ucsstnd2 ~]$


Подскажите, как избавиться от этого:
Код: sql
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
__udisks ()
{
    local IFS='
';
    local cur="${COMP_WORDS[COMP_CWORD]}";
    if [ "${COMP_WORDS[$(($COMP_CWORD - 1))]}" = "--show-info" ]; then
        COMPREPLY=($(compgen -W "$(udisks --enumerate-device-files)" -- $cur));
    else
        if [ "${COMP_WORDS[$(($COMP_CWORD - 1))]}" = "--inhibit-polling" ]; then
            COMPREPLY=($(compgen -W "$(udisks --enumerate-device-files)" -- $cur));
        else
            if [ "${COMP_WORDS[$(($COMP_CWORD - 1))]}" = "--mount" ]; then
                COMPREPLY=($(compgen -W "$(udisks --enumerate-device-files)" -- $cur));
            else
                if [ "${COMP_WORDS[$(($COMP_CWORD - 1))]}" = "--unmount" ]; then
                    COMPREPLY=($(compgen -W "$(udisks --enumerate-device-files)" -- $cur));
                else
                    if [ "${COMP_WORDS[$(($COMP_CWORD - 1))]}" = "--detach" ]; then
                        COMPREPLY=($(compgen -W "$(udisks --enumerate-device-files)" -- $cur));
                    else
                        if [ "${COMP_WORDS[$(($COMP_CWORD - 1))]}" = "--ata-smart-refresh" ]; then
                            COMPREPLY=($(compgen -W "$(udisks --enumerate-device-files)" -- $cur));
                        else
                            if [ "${COMP_WORDS[$(($COMP_CWORD - 1))]}" = "--ata-smart-simulate" ]; then
                                _filedir || return 0;
                            else
                                if [ "${COMP_WORDS[$(($COMP_CWORD - 1))]}" = "--set-spindown" ]; then
                                    COMPREPLY=($(compgen -W "$(udisks --enumerate-device-files)" -- $cur));
                                else
                                    if [ "${COMP_WORDS[$(($COMP_CWORD - 1))]}" = "--poll-for-media" ]; then
                                        COMPREPLY=($(compgen -W "$(udisks --enumerate-device-files)" -- $cur));
                                    else
                                        COMPREPLY=($(IFS=: compgen -W "--dump:--inhibit-polling:--inhibit-all-polling:--enumerate:--enumerate-device-files:--monitor:--monitor-detail:--show-info:--help:--mount:--mount-fstype:--mount-options:--unmount:--unmount-options:--detach:--detach-options:--ata-smart-refresh:--ata-smart-wakeup:--ata-smart-simulate:--set-spindown:--set-spindown-all:--spindown-timeout:--poll-for-media" -- $cur));
                                    fi;
                                fi;
                            fi;
                        fi;
                    fi;
                fi;
            fi;
        fi;
    fi
}



Спасибо.

Best Regards, Bauer.
...
Рейтинг: 0 / 0
14.08.2017, 16:04
    #39505063
Vadim Lejnin
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Bash completion
Код: sql
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
$ set | tail -4
USER=oracle
_=t.bash
colors=/etc/DIR_COLORS
dropme ()
{
    echo dropme: $1
}
$ unset dropme
$ set | tail
SQLPATH=/home/oracle/sql
SSH_CLIENT='10.10.5.40 61286 22'
SSH_CONNECTION='10.10.5.40 61286 172.19.5.126 22'
SSH_TTY=/dev/pts/0
TERM=xterm
UID=54321
ULIMIT=unlimited
USER=oracle
_=dropme
colors=/etc/DIR_COLORS
...
Рейтинг: 0 / 0
15.08.2017, 14:08
    #39505608
Bauer
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Bash completion
Спасибо, работает. Но, это следствие, а как искоренить причину?
...
Рейтинг: 0 / 0
15.08.2017, 15:03
    #39505679
Vadim Lejnin
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Bash completion
BauerСпасибо, работает. Но, это следствие, а как искоренить причину?
Код: sql
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
man bash
...
FILES
       /bin/bash
              The bash executable
       /etc/profile
              The systemwide initialization file, executed for login shells
       /etc/bash.bash_logout
              The systemwide login shell cleanup file, executed when a login shell exits
       ~/.bash_profile
              The personal initialization file, executed for login shells
       ~/.bashrc
              The individual per-interactive-shell startup file
       ~/.bash_logout
              The individual login shell cleanup file, executed when a login shell exits
       ~/.inputrc
              Individual readline initialization file


Искать где у тебя в bash startup files определяется данная функция
Код: sql
1.
2.
3.
4.
5.
6.
7.
~/.profile
~/.bash_profile
~/.bashrc
/etc/profile
/etc/profile.d/*
/etc/bashrc
grep __udisks  /etc/bashrc /etc/profile /etc/profile.d/* ~/.bash_profile ~/.bashrc



p.s. Внешние определения могут быть загружены командами
Код: sql
1.
2.
3.
source /path/file
или
. /path/file
...
Рейтинг: 0 / 0
17.08.2017, 13:52
    #39506826
Bauer
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Bash completion
Спасибо за ответ.

мой ман на баш...

Код: sql
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
 /bin/bash
              The bash executable
       /etc/profile
              The systemwide initialization file, executed for login shells
       /etc/bash.bash_logout
              The systemwide login shell cleanup file, executed when a login shell exits
       ~/.bash_profile
              The personal initialization file, executed for login shells
       ~/.bashrc
              The individual per-interactive-shell startup file
       ~/.bash_logout
              The individual login shell cleanup file, executed when a login shell exits
       ~/.inputrc




Хвостов не нашел.
Откуда берется этот "мусор" - непонятно...
...
Рейтинг: 0 / 0
17.08.2017, 16:15
    #39506988
Vadim Lejnin
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Bash completion
BauerСпасибо за ответ.

мой ман на баш...

Код: sql
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
 /bin/bash
              The bash executable
       /etc/profile
              The systemwide initialization file, executed for login shells
       /etc/bash.bash_logout
              The systemwide login shell cleanup file, executed when a login shell exits
       ~/.bash_profile
              The personal initialization file, executed for login shells
       ~/.bashrc
              The individual per-interactive-shell startup file
       ~/.bash_logout
              The individual login shell cleanup file, executed when a login shell exits
       ~/.inputrc




Хвостов не нашел.
Откуда берется этот "мусор" - непонятно...
Тогда глобальный поиск:
Код: sql
1.
find / -type f -exec file {} \; 2>&1 | grep text | cut -f1 -d: | while read f;do grep -l $f; done
...
Рейтинг: 0 / 0
17.08.2017, 16:18
    #39506995
Vadim Lejnin
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Bash completion
А проще спросить гугла
/etc/bash_completion.d/udisks-bash-completion.sh
...
Рейтинг: 0 / 0
Форумы / Unix-системы [игнор отключен] [закрыт для гостей] / Bash completion / 7 сообщений из 7, страница 1 из 1
Целевая тема:
Создать новую тему:
Автор:
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]