Q: How to execute bash function inside other function I have this code:
myecho() {
    if [ -z "$1" ]
        then
            echo "if";
    else
        echo "else";
    fi
}
alias myecho=myecho

callmyecho() {

        append="stuff";
        myechoResult='myecho'; #`myecho` wont execute here!
        echo $myechoResult$append 
}

How I can execute myecho inside callmyecho and append a new text to it?

A: Editing your code as follows:
#!/bin/bash

myecho() {
  if [ -z "$1" ]; then
      echo "if"
  else
      echo "else"
  fi
}

callmyecho() {
  append="stuff"
  myechoResult=`myecho`
  echo $myechoResult$append
}

# callmyecho

If you want to call callmyecho within the file and have it execute the myecho function within its block, simply uncomment callmyecho by removing '#'.
On the other hand, if you want to call on the callmyecho function from the terminal, then source the file script first as follows:
$ source ./file

Then you can call on any function inside that file script and it will execute.
