- Bash Cookbook
- Ron Brash Ganesh Naik
- 162字
- 2021-07-23 19:17:31
Including source files
In addition to functions, we can also create multiple scripts and include them such that we can utilize any shared variables of functions.
Let's say we have a library or utility script that contains a number of functions useful for creating files. This script by itself could be useful or reusable for a number of scripting tasks, so we make it program neutral. Then, we have another script, but this one is dedicated to a single task: performing useless file system operations (IO). In this case, we would have two files:
- io_maker.sh (which includes library.sh and uses library.sh functions)
- library.sh (which contains declared functions, but does not execute them)
The io_maker.sh script simply imports or includes the library.sh script and inherits knowledge of any global variables, functions, and other inclusions. In this manner, io_maker.sh effectively thinks that these other available functions are its own and can execute them as if they were contained within it.
- Getting Started with React
- Software Testing using Visual Studio 2012
- 區(qū)塊鏈架構(gòu)與實(shí)現(xiàn):Cosmos詳解
- Koa開發(fā):入門、進(jìn)階與實(shí)戰(zhàn)
- Kotlin編程實(shí)戰(zhàn):創(chuàng)建優(yōu)雅、富于表現(xiàn)力和高性能的JVM與Android應(yīng)用程序
- Java Web應(yīng)用開發(fā)給力起飛
- OpenCV Android Programming By Example
- JavaScript前端開發(fā)基礎(chǔ)教程
- C語言程序設(shè)計(jì)教程
- Beginning PHP
- RESTful Web API Design with Node.js
- Learning Swift
- 流程讓管理更高效:流程管理全套方案制作、設(shè)計(jì)與優(yōu)化
- Scratch 3.0少兒游戲趣味編程
- Visual C++ 2017網(wǎng)絡(luò)編程實(shí)戰(zhàn)