E
E
eegmak2021-05-02 20:40:18
bash
eegmak, 2021-05-02 20:40:18

How to replace the messagebox in sh so that you can enter data into the script?

there is an e-ink book where it is possible to run the code in the following way:

#!/bin/sh 
par1="$(echo $SHELL)"
messagebox "${par1}"

the disadvantage is that there is no interactivity, interaction with the user, because the result of the command can simply be displayed in the messagebox.
Advise how to enter data by analogy with messagebox?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Saboteur, 2021-05-02
@eegmak

messagebox is not a shell command, it is some function in this book. Find it and read what's going on there.

X
xotkot, 2021-05-03
@xotkot

Advise how to enter data by analogy with messagebox?

how can we know what kind of messagebox you have there.
in linux, at the level of bash (sh) scripts for graphical (GUI) interaction with users, one of the tools is usually used: kdialog, zenity, yad, wish
as an example: we will get the number entered in the field into the console to roll it into a variable right away, you can wrap it: now variable a will contain our entered number
; zenity --entry --text="Введите число:"
608f8f6461f94089042878.png
; a=$(zenity --entry --text="Введите число:")

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question