Changes between Version 1 and Version 2 of FAQ_T22_F26


Ignore:
Timestamp:
2013/05/07 23:08:12 (11 years ago)
Author:
yasumichi
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • FAQ_T22_F26

    v1 v2  
    11== コマンドやオプションが長すぎて入力が大変です == 
    22 
     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 
     14function aptsearch () { /usr/bin/apt-cache search "$1" ;} 
     15function aptsearchname () { /usr/bin/apt-cache search --names-only "$1" ;} 
     16function aptsearchpkgnames () { /usr/bin/apt-cache pkgnames "$1" ;} 
     17function aptshow () { /usr/bin/apt-cache show "$1" ;} 
     18function aptshowpkg () { /usr/bin/apt-cache showpkg "$1" ;} 
     19function aptshowsrc () { /usr/bin/apt-cache showsrc "$1" ;} 
     20function aptcategory () { /usr/bin/apt-cache showpkg "$1" | /bin/grep -e "Package" -e "/lists/" ;} 
     21 
     22function aptsrc () { /usr/bin/apt-get source "$1" ;} 
     23function aptsrc-d () { /usr/bin/apt-get source -d "$1" ;} 
     24 
     25function slrpmqf () { /usr/bin/slocate "$1" | /usr/bin/xargs rpm -qf ;} 
     26function whichrpmqf () { which "$1" ; which "$1" | /usr/bin/xargs rpm -qf ;} 
     27 
     28function rpmlogh () { /bin/rpm -q --changelog "$1" | /usr/bin/head ;} 
     29function rpmlogh-p () { /bin/rpm -q --changelog -p "$1" | /usr/bin/head ;} 
     30function rpmlogl () { /bin/rpm -q --changelog "$1" | /usr/bin/lv ;} 
     31function rpmlogl-p () { /bin/rpm -q --changelog -p "$1" | /usr/bin/lv ;} 
     32}}}