How to send yes/no with dialog box in bash shell


Recommended Posts

Armbianmonitor:

Hi.

I am digging many things with armbian so I install fresh armbian and many applications so many times.

So I am making a long script to install many applications and edit many configuration.

When it asked "Yes/On" on text prompt, I use "#echo yes | apt install vim". It works well.

But when I install samba, it ask text prompt "yes/no" at first and then with dialog box "yes/no".

So I tried "#echo yes | echo no | apt install samba". But it doesn't work.

How can I send "yes/no" to dialog box in bash shell??

 

Link to post
Share on other sites
Armbian is a community driven open source project. Do you like to contribute your code?

5 hours ago, kimwida said:
When it asked "Yes/On" on text prompt, I use "#echo yes | apt install vim". It works well.

But when I install samba, it ask text prompt "yes/no" at first and then with dialog box "yes/no".

So I tried "#echo yes | echo no | apt install samba". But it doesn't work.

How can I send "yes/no" to dialog box in bash shell??

 

 

I dont know if it works for a samba-dialog-box, but you could try the following options with apt-get (not only apt):
 

root@npi-neo2-22(192.168.6.22):~# man apt-get|grep yes
       -y, --yes, --assume-yes
           Automatic yes to prompts; assume "yes" as answer to all prompts and run non-interactively. If an
           Force yes; this is a dangerous option that will cause apt to continue without prompting if it is
           Force yes; this is a dangerous option that will cause apt to continue without prompting if it is
       --force-yes
           Force yes; this is a dangerous option that will cause apt to continue without prompting if it is
           force-yes can potentially destroy your system! Configuration Item: APT::Get::force-yes. This is
           --assume-yes; where --assume-yes will answer yes to any prompt, --trivial-only will answer no.

So without echo you could try

apt-get install vim -y

or

apt-get install vim --force-yes

 

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...