Echo output to terminal within function in BASH

后端 未结 4 1317
情深已故
情深已故 2020-12-31 04:38

I am writing a script in BASH. I have a function within the script that I want to provide progress feedback to the user. Only problem is that the echo command does not print

4条回答
  •  南笙
    南笙 (楼主)
    2020-12-31 05:20

    send terminal output to stderr:

    function test_function {
        echo "Echo value to terminal" >&2
        echo "return value"
    }
    

提交回复
热议问题