| | 3 | [wiki:docs/VinePlus VinePlus] にある zsh のような高度な補完ができるシェルを利用すれば、コマンドの後のオプションなども TAB キー等で補完することができます。 |
| | 4 | |
| | 5 | また、標準の bash でも alias や function を利用してある程度入力を簡単にすることができます。function や alias などについては man bash などを参照してください。 |
| | 6 | |
| | 7 | 筆者は、~/.bashrc に次のような function を定義して利用しています。 |
| | 8 | |
| | 9 | # set aliases として alias がいくつか定義されているその下に # set functions などとして下のようなものを追加してみるといいかもしれません。 |
| | 10 | |
| | 11 | {{{ |
| | 12 | #!sh |
| | 13 | # functions for apt,rpm |
| | 14 | function aptsearch () { /usr/bin/apt-cache search "$1" ;} |
| | 15 | function aptsearchname () { /usr/bin/apt-cache search --names-only "$1" ;} |
| | 16 | function aptsearchpkgnames () { /usr/bin/apt-cache pkgnames "$1" ;} |
| | 17 | function aptshow () { /usr/bin/apt-cache show "$1" ;} |
| | 18 | function aptshowpkg () { /usr/bin/apt-cache showpkg "$1" ;} |
| | 19 | function aptshowsrc () { /usr/bin/apt-cache showsrc "$1" ;} |
| | 20 | function aptcategory () { /usr/bin/apt-cache showpkg "$1" | /bin/grep -e "Package" -e "/lists/" ;} |
| | 21 | |
| | 22 | function aptsrc () { /usr/bin/apt-get source "$1" ;} |
| | 23 | function aptsrc-d () { /usr/bin/apt-get source -d "$1" ;} |
| | 24 | |
| | 25 | function slrpmqf () { /usr/bin/slocate "$1" | /usr/bin/xargs rpm -qf ;} |
| | 26 | function whichrpmqf () { which "$1" ; which "$1" | /usr/bin/xargs rpm -qf ;} |
| | 27 | |
| | 28 | function rpmlogh () { /bin/rpm -q --changelog "$1" | /usr/bin/head ;} |
| | 29 | function rpmlogh-p () { /bin/rpm -q --changelog -p "$1" | /usr/bin/head ;} |
| | 30 | function rpmlogl () { /bin/rpm -q --changelog "$1" | /usr/bin/lv ;} |
| | 31 | function rpmlogl-p () { /bin/rpm -q --changelog -p "$1" | /usr/bin/lv ;} |
| | 32 | }}} |