Hot answers tagged

6

Have you tried using dialog? It comes standard with most Linux distros and can create all kinds of text-based dialogs, including checklists. For example: exec 3>&1 # open temporary file handle and redirect it to stdout # type title width height n-items items=$(dialog --no-lines --checklist "Title here" 20 ...


4

What you are missing is that most terminal descriptions (linux is in the minority here, owing to the pervasive use of hard-coded strings in .inputrc) use application mode for special keys. That makes cursor-keys as shown by tput and infocmp differ from what your (uninitialized) terminal sends. curses applications always initialize the terminal, and the ...


2

No. A script or shell function may inspect $- and look for an i (which indicates that this is an interactive shell), or it may look for a controlling tty (with tty for example), but neither of these are fool-proof methods. Even if you, as root, logged all executed commands from a user's shell session, or looked at their shell history file, you would still ...


1

Whilst there's really no fool-(or forge)-proof methods (at least I don't know), technically you can check the difference e.g. by: root@aw [~]# set > cons root@aw [~]# cat ./test.sh #!/bin/bash set > scri root@aw [~]# ./test.sh then root@aw [~]# diff cons scri There are a lot of differences, select any you like.



Only top voted, non community-wiki answers of a minimum length are eligible