金沙国际Debian sudo自动补全

#defineTIME_TAB_MAX245charg_time_tab[TIME_TAB_MAX][6]={"13:46","08:23","23:12","05:59",..."09:13","12:00","02:42","22:29",......};charg_sleep_time[6]={"21:30"};用C语言编写函数,从g_time_tab中寻觅最相近g_sleep_time的时间,并且printf出结果。

1.透过成分的sendkeys完成简单的键盘操作:

养虎遗患 debian sudo TAB 键不能够自动补全命令的案由
貌似情况,命令行输入 sudo apt-get ins 按 tab ,它背后会自行补全为 install 即便右面写了包的名的少年老成部分,按 tab 它也会活动落成或列出候选的,本次parrotOS(基于debian)猛然倒霉使了
率先确定是否安装了 自动补全的插件,输入
apt-get install bash-completion
然后在/etc/bash.bashrc :
即 在 .bash_profile 里加
if [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
就 ok 了
链接:
完整 copy 下来吧:
Add Bash Completion In Debian
ash completion is a useful tool for completion of file paths, commands etc. By default it is enabled on Ubuntu but not on Debian. With two simple steps it can also be enabled on Debian.

#coding=utf-8

from selenium import webdriver

#要运用键盘操作,首先须要引进keys 包

from selenium.webdriver.common.keys import Keys

#import os

import time

driver = webdriver.Ie()

driver.get("")

time.sleep(3)

driver.maximize_window() # 浏览器全屏呈现

#driver.find_element_by_id("username_L70iK").clear()

driver.find_element_by_name("username").send_keys("1290800466")

#tab 的一贯相相于湮灭了密码框的暗中同意提醒新闻,等同下边包车型地铁clear(卡塔尔

#通过.send_keys(keys.开关名称卡塔尔调用开关:

#.send_keys(Keys.TAB) # 按TAB键

#.send_keys(Keys.ENTER) # 按回车键

driver.find_element_by_name("username").send_keys(Keys.TAB)

time.sleep(3)

driver.find_element_by_name("password").send_keys("15866584957")

#经过一定密码框,enter(回车)来取代登录按键

driver.find_element_by_name("password").send_keys(Keys.ENTER)

time.sleep(5)

driver.quit()

  1. Install bash-completion
    First of all we need the install the according package:
    apt-get install bash-completion
  2. Add it to the bash profile
    Either edit the ~/.bash_profile file to enable it only for a given user or edit /etc/profile to add it system-wide. Add the following code:
    if [ -f /etc/bash_completion ]; then
    . /etc/bash_completion
    fi
  3. Try it
    In order for it to work you have to log out and relogin and then you can make use of bash completion the usual way. E.g. issue:
    apt-g
    and then press the TAB key once and the command will be completed to apt-get. Or issue this:
    apt
    and then press TAB key twice. You can also try with
    apt-get install apa
    and then press TAB key once to complete as far as possible and a second time to list all options.