I have found the following script causes a segmentation fault and core in KornShell (ksh) on AIX. Can anyone explain why I get the following results?
doOutput(){
Echo "Something"
}
doOutput() >&1
OR
doOutput(){
Echo "Something"
}
echo `doOutput()`
doOutput(){
Echo "Something"
}
doOutput()
doOutput(){
Echo "Something"
}
doOutput
OR
doOutput(){
Echo "Something"
}
doOutput >&1
Calls to functions in shells such as ksh don’t use parentheses. They are only used during function definition.
Correct:
If you call a function with parameters, you separate them using spaces (no parentheses):
Incorrect:
Plus, why are you redirecting stdout to stdout (
>&1)?