Open main menu

CDOT Wiki β

Changes

Tutorial10: Shell Scripting - Part 1

122 bytes removed, 08:16, 9 July 2020
Creating & Executing Shell Scripts
It is recommended to '''plan''' out on a piece of paper the purpose of the shell script.<br>You can do this by creating a simple '''IPSO''' diagram (stands for '''INPUT''', '''PROCESSING''', '''STORAGE''', '''OUTPUT''').
First, list the INPUTS into the script (eg. prompting user for data, reading data from file, etc), then listing the expected OUTPUTS from the script.<br>Finally, you You can listing then list the steps to process the INPUT to provide the OUTPUT (including file storage).<br>In the case, you start with the diagram, then generate a list of steps that will help you code your shell script.
Once you have planned your shell script by listing the sequence of steps in your script, you need to create a file that will contain your Linux commands. '''NOTE: ''' Avoid using filenames of already existing Linux Commands to avoid confusion. Using shell script filenames that include the file extension of the shell that the script will run within is recommended.
===Using Variables in Shell Scripts===
13,420
edits