How to load functions or variables in javastushell Programming

Source: Internet
Author: User
Using tushell programming to call functions or variables defined by other files #! /Bin/shif [-rbackfunc]; then./home/fef/shell/backfunc # "." There is an empty backend.

Methods for calling functions or variables defined by other files in Ubuntu Shell programming

  1. #! /Bin/sh
  2. If [-r backfunc]; then
  3. ./Home/fef/shell/backfunc # "." There is a space behind it, and backfunc must use an absolute path !!
  4. Else
  5. Echo "'basename $ 0' cannot locate backfunc file"
  6. Fi
  7. Echo-n "Enter the code name :"
  8. If ["$ CODE "! = "$ _ CODE"]; then
  9. Echo "Wrong code... exiting... will use default"
  10. Exit 1
  11. Fi
  12. Echo "The environment config file reports"
  13. Echo "FULL backup Required: $ _ FULLBACKUP"
  14. Echo "$ LOGFILE"

The content of the backfunc file is as follows:
  1. #! /Bin/sh
  2. # Name: backfunc
  3. # Config file that holds the defaults for the archive systems
  4. _ CODE="Comet"
  5. _ FULLBACKUP="Yes"
  6. _ LOGFILE="/Logs/backup"
  7. _ DEVICE="/Dev/rmt/On"
  8. _ INFORM="Yes"
  9. _ PRINT_STATS="Yes"
Run the above script $: sh readfunc comet.

Result:

The environment config file reports
FULL backup Required : Yes

For more information about Ubuntu, see Ubuntu special page http://www.linuxidc.com/topicnews.aspx? Tid = 2

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.