Download presentation
Presentation is loading. Please wait.
Published bySilas Parks Modified over 9 years ago
2
GNU Compiler Collection (GCC) and GNU C compiler (gcc) tools used to compile programs in Linux
6
Hello World! program compilation in C #include int main() { printf("hello world!\n"); }
7
PERL, Python, and bash—script interpreters in Linux Python is for rapid GUI development PERL is for complex jobs and Web pages bash is for everyday, general-purpose scripting.
8
Control structures used to develop scripting logic If...Then...Else statements Case statements For loops While loops table on page 907
9
BASH Scripting Shell scripting provides a way to automate everyday tasks into much simpler commands. –For example, to add 200 users would require running the useradd command 200 times. The first line of a script identifies the shell or interpreter used to run this script. – Linux uses BASH as the default shell so #! /bin/bash is the first line of BASH scripts.
10
Any line with a # sign is a comment line. –Use comments to document what a script is doing. BASH scripting is basically taking several commands into one file in the sequence you wish them executed.
11
The read statement reads the value of a variable from stdin (standard input). –It fetches input from the keyboard or a source redirected to it. read a will read a single value from stdin read a b c will read multiple values on a single line from stdin. You don’t have to declare variables, just use them –VAR1 = 2 –VAR2 = “Hello, World”
12
Any arguments to the script are numbered $1, $2, $3, etc and used in the script by their numbers The echo line displays values. –It can display text: echo “Hello, world” –It can display the contents of a variable: echo VAR1
13
pg905
14
Lab5.2
15
Pg911
16
Pg 929
17
Lab 5.4 pg919 ex.
18
Pg 921 Lab 5.5
20
The Read command the Read command will be used with the While loop to take input from a file. This requires the use of the standard input redirector. Pg 956
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.