Ask a shell programming question

Source: Internet
Author: User
Ask a shell programming question-Linux general technology-Linux programming and kernel information. The following is a detailed description. I want to use the bash script to implement batch processing. This script can start several related programs at a time, but one of them has a select menu option, you need to enter a number to select when it starts. I want to assign a value to it in the bash script so that I don't have to select this option every time I start the script.

Specifically, when I access the internet in the dormitory, because of the network management of the school, I need to start a client named upnet. I typed upnet in Konsole or gnome terminal and then press Enter, it then displays a menu selection item, such as 1) XXXXXXXXXXXXX. I have to enter 1 to log on to the client, and then I enter firefox and press enter to start the browser to access the Internet.

So I want to use a bash script named www. bash to implement this series of operations.
For example
#! /Bin/bash
Upnet
Firefox

Obviously, you cannot assign values to the upnet menu in one step. In this case, how can you assign values to the upnet menu options in the script to implement the www operation. bash can log on to the client and open firefox without further intervention?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.