View Single Post
Old 03-30-2012, 05:42 PM   #12
geekmaster
Carpe diem, c'est la vie.
geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.
 
geekmaster's Avatar
 
Posts: 6,433
Karma: 10773670
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
Quote:
Originally Posted by kaminkatze View Post
I used this kite script
Code:
#!/bin/sh
/mnt/us/bin/tinysh &
to start tinysh and modified
Code:
[[ $K -eq $ENT ]]&& shcmd && continue
to something like
Code:
if [[ $K -eq $ENT ]]; then
  [[ $CMD == "quit" ]] && exit
  shcmd && continue
fi
so I can exit tinysh.
That looks good, except now you cannot send "quit" to the shell or to a linux program. I would use something unusual but easy to type, like ".quit.", or use an undefined button (such as Menu) as a "command" key (which sets a "command" flag). Then at Enter key processing, exit if command flag set AND "quit" in CMD buffer. Remember to clear the command flag at end of Enter key processing. A "command" button could support other "local" options as well, such as clearing or refreshing the display, or even executing command macros to save typing long commands.

Remember that the K3 and earlier already have a nicer onscreen shell (I recommend myts-7). This script was meant to be used in special cases, like during debricking, but especially as an example of what you CAN do with a shell script, using ONLY stuff that is already built-in. And modifying this as you are doing is a GREAT learning experience.


P.S. How did you get tinysh working in kite, instead of only telnet as you had previously reported?

Last edited by geekmaster; 03-30-2012 at 06:04 PM.
geekmaster is offline   Reply With Quote