I have a function err()
in file abc
. The files do not have a .sh
extension, but they start with #!/bin/bash
.
err () {
echo "${1}" >&2
}
Now I am importing it in a different file xyz
:
source abc
someFunction(){
err "Failed to back up"
}
Is this the right way of importing?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…