Jump to content

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


kimwida

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 comment
Share on other sites

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 comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

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...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines