Bash Function -> Command not found

前端 未结 4 962
后悔当初
后悔当初 2021-01-17 11:11

Hi gusy I am trying to learn Bash and cannot seem to get this basic script to work.

#!/bin/bash

function system_info
{    
    echo \"function system_info\"         


        
4条回答
  •  时光说笑
    2021-01-17 11:39

    Invoke the function inside the script with just the function name and execute the script from the shell

    #!/bin/bash
    function system_info {
    echo "function system_info"
    }
    system_info
    

提交回复
热议问题