Distributions
Ubuntu
Fedora
CentOS
中文资源站
网易开源镜像站
soonlai
V2EX  ›  Linux

bash 函数调用求解

  •  
  •   soonlai · Apr 23, 2013 · 4250 views
    This topic created in 4774 days ago, the information mentioned may be changed or developed.
    function fcontent() {

    grep -nHR --color=auto '$@' .

    } #查找所有文件内容

    这是我的函数,当我像这样调用 fcontent explain ,$@ 没有替换。
    2 replies    1970-01-01 08:00:00 +08:00
    arbeitandy
        1
    arbeitandy  
       Apr 23, 2013
    用雙引號

    #!/bin/bash
    function fcontent() {
    grep -nHR --color=auto "$@" .
    }
    soonlai
        2
    soonlai  
    OP
       Apr 23, 2013
    不错,谢谢!
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1024 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 19:25 · PVG 03:25 · LAX 12:25 · JFK 15:25
    ♥ Do have faith in what you're doing.