I wrote a ksh function for git checkout (I've removed some irrelevant proprietary components for the sake of the public question, if you're wondering why it's useful to me):
# Checkout quicker
checkout(){
if [ "$1" == "master" ]; then
git checkout master
else
git checkout $1
fi
}
When I look at the function on the command line using functions, though, I get an odd output:
$ functions checkout
checkout()
}
# Checkout quicker
checkout(){
if [ "$1" == "master" ]; then
git checkout master
else
$ <- (this is my PS1, which I'm not writing here because it's big)
Why is the function not displaying properly? Did I break functions by technically using the function name inside the function? I am using ksh93u+ 2012-08-01 on RHEL.
functions? Is that some shell builtin in your shell? And what operating system?functionsis an alias fortypeset -f. I thought it was a built-in, maybe not.ksh --version:sh (AT&T Research) 2020.0.0in Arch Linuxcentos:7withksh-20120801-144.el7_9.armv7hl(ksh --version:sh (AT&T Research) 93u+ 2012-08-01). No luck there either. But in my case it doesn't include the comment before the function.