1 / 20

GNU Compiler Collection (GCC) and GNU C compiler (gcc)

GNU Compiler Collection (GCC) and GNU C compiler (gcc). tools used to compile programs in Linux. Hello World! program compilation in C. #include &lt;stdio.h&gt; int main() { printf(&quot;hello world!<br>&quot;); }. PERL, Python, and bash—script interpreters in Linux. Python is for rapid GUI development

dian
Download Presentation

GNU Compiler Collection (GCC) and GNU C compiler (gcc)

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. GNU Compiler Collection (GCC) and GNU C compiler (gcc) • tools used to compile programs in Linux

  2. Hello World! program compilation in C • #include <stdio.h> • int main() • { • printf("hello world!\n"); • }

  3. 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.

  4. Control structures used to develop scripting logic • If...Then...Else statements • Case statements • For loops • While loops • table on page 907

  5. 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.

  6. 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.

  7. 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”

  8. 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

  9. pg905

  10. Lab5.2

  11. Pg911

  12. Pg 929

  13. Lab 5.4 pg919 ex.

  14. Pg 921 Lab 5.5

  15. 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

More Related