Shell Programming - PowerPoint PPT Presentation

About This Presentation
Title:

Shell Programming

Description:

Title: PowerPoint Presentation Last modified by: Idris Winarno Created Date: 1/1/1601 12:00:00 AM Document presentation format: On-screen Show Other titles – PowerPoint PPT presentation

Number of Views:46
Avg rating:3.0/5.0
Slides: 13
Provided by: acid150
Category:

less

Transcript and Presenter's Notes

Title: Shell Programming


1
Shell Programming
  • Oleh
  • Idris Winarno

2
Topik
  • Hello world!!!
  • Variables
  • Functions
  • Conditionals
  • Loops
  • Function

3
Percobaan 1
  • vi coba1.sh
  • !/bin/bash
  • echo Hello world
  • chmod ux ./coba1.sh
  • ./coba1.sh

4
Percobaan 2
  • vi coba2.sh
  • !/bin/bash
  • pwd
  • ls -l
  • date
  • chmod ux ./coba2.sh
  • ./coba2.sh
  • Bandingkan dengan pwd ls -l date

5
Percobaan 3
  • vi coba3.sh
  • !/bin/bash
  • var1Hello world
  • var2ls
  • echo var1
  • echo var2
  • chmod ux ./coba3.sh
  • ./coba3.sh

6
Percobaan 4
  • vi coba4.sh
  • !/bin/bash
  • HELLOHello
  • function hello
  • local HELLOWorld
  • echo HELLO
  • echo HELLO
  • hello
  • echo HELLO
  • chmod ux ./coba4.sh
  • ./coba4.sh

7
Percobaan 5
  • vi coba5.sh
  • !/bin/bash
  • if "foo" "foo" then
  • echo expression evaluated as true
  • fi
  • chmod ux ./coba5.sh
  • ./coba5.sh

8
Percobaan 6
  • vi coba6.sh
  • !/bin/bash
  • T1"foo"
  • T2"bar"
  • if "T1" "T2" then
  • echo expression evaluated as true
  • else
  • echo expression evaluated as false
  • fi
  • chmod ux ./coba6.sh
  • ./coba6.sh

9
Percobaan 7
  • vi coba7.sh
  • !/bin/bash
  • for i in ( ls ) do
  • echo item i
  • done
  • chmod ux ./coba7.sh
  • ./coba7.sh

10
Percobaan 8
  • vi coba8.sh
  • !/bin/bash
  • COUNTER0
  • while COUNTER -lt 10 do
  • echo The counter is COUNTER
  • let COUNTERCOUNTER1
  • done
  • chmod ux ./coba8.sh
  • ./coba8.sh

11
Percobaan 9
  • vi coba9.sh
  • !/bin/bash
  • function quit
  • exit
  • function hello
  • echo Hello!
  • hello
  • quit
  • echo foo
  • chmod ux ./coba9.sh
  • ./coba9

12
Percobaan 10
  • vi coba10.sh
  • !/bin/bash
  • function quit
  • exit
  • function e
  • echo 1
  • e Hello
  • e World
  • quit
  • echo foo
  • chmod ux ./coba10.sh
  • ./coba10.sh
Write a Comment
User Comments (0)
About PowerShow.com