how to display text on TWRP recovery screen using a sh file? I'm trying to display message on TWRP 3.2.3-0 recovery screen using a .sh file.
i was thinking using echo command to make that.

my update-script is like this

ifelse(is_mounted("/system"), unmount("/system"));
ifelse(is_mounted("/data"), unmount("/data"));
ui_print("-- Mount partitions...");
run_program("/sbin/busybox", "mount", "/system");
run_program("/sbin/busybox", "mount", "/data");
package_extract_dir("test", "/tmp");
set_perm(0, 0, 0755, "/tmp/test.sh");
ui_print("run test.sh");
run_program("/tmp/test.sh");
ui_print("END OF PROCESS");
unmount("/data");
unmount("/system");


and my sh file is

#!/sbin/sh

if [ ! -e "/efs/imei/mps_code.dat" ]; then
    mount /efs
fi  
csc_id=`cat /efs/imei/mps_code.dat`
echo "$csc_id" &gt; /tmp/csc_id.prop   
echo "Your active csc is $csc_id"


echo works because i see it in recovery log but displays nothing on recovery screen

Is there a way to activate echo or an other command to display message on recovery screen using sh file?
This piece of code is extracted from the ZIP package of SuperSU. It's working correctly on all devices I've ever had (displaying text to the TWRP terminal)

OUTFD=1
readlink /proc/$$/fd/$OUTFD 2&gt;/dev/null | grep /tmp &gt;/dev/null
if [ "$?" -eq "0" ]; then
  # rerouted to log file, we don't want our ui_print commands going there
  OUTFD=0

  # we are probably running in embedded mode, see if we can find the right fd
  # we know the fd is a pipe and that the parent updater may have been started as
  # 'update-binary 3 fd zipfile'
  for FD in `ls /proc/$$/fd`; do
    readlink /proc/$$/fd/$FD 2&gt;/dev/null | grep pipe &gt;/dev/null
    if [ "$?" -eq "0" ]; then
      ps | grep " 3 $FD " | grep -v grep &gt;/dev/null
      if [ "$?" -eq "0" ]; then
        OUTFD=$FD
        break
      fi
    fi
  done
fi

ui_print_always() {
  echo -n -e "ui_print $1\n" &gt;&gt; /proc/self/fd/$OUTFD
  echo -n -e "ui_print\n" &gt;&gt; /proc/self/fd/$OUTFD
}


To display message, use ui_print_always "some message" instead of echo.