User Tools

Site Tools


linux:bash

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
linux:bash [2017/02/22 04:27] – [Variabel] kbadminlinux:bash [2021/09/23 19:05] (current) – [0.2 Variable berisi Perintah] kbadmin
Line 1: Line 1:
-====== Tutorial Linux Bash Scripting & Contoh Program ======+====== Bahasa Pemprograman Bash Script Linux ======
 Bash adalah pemrograman dasar berbasis unix atau linux yang diciptakan oleh [[https://en.wikipedia.org/wiki/Brian_Fox_(computer_programmer)|Brian Fox]] untuk [[https://en.wikipedia.org/wiki/GNU_Project|Proyek GNU]]. Distribusi pertama tahun 1989 selanjutnya digunakan secara luas pada Linux dan Apple MacOS. Bash adalah pemrograman dasar berbasis unix atau linux yang diciptakan oleh [[https://en.wikipedia.org/wiki/Brian_Fox_(computer_programmer)|Brian Fox]] untuk [[https://en.wikipedia.org/wiki/GNU_Project|Proyek GNU]]. Distribusi pertama tahun 1989 selanjutnya digunakan secara luas pada Linux dan Apple MacOS.
  
Line 46: Line 46:
 Penjelasan detail bisa baca di [[http://stackoverflow.com/questions/8967902/why-do-you-need-to-put-bin-bash-at-the-beginning-of-a-script-file|stackoverflow]] Penjelasan detail bisa baca di [[http://stackoverflow.com/questions/8967902/why-do-you-need-to-put-bin-bash-at-the-beginning-of-a-script-file|stackoverflow]]
  
 +===== Comment Block =====
 +Anda bisa menambahkan komentar pada script dengan menambahkan tanda "#" pada bagian depan
 +<code>
 +#!/bin/bash
 +
 +#ini adalah komentar
 +#ini adalah komentar kedua
 +
 +echo "Assalamu'alaikum"
 +
 +</code>
 ===== Variabel ===== ===== Variabel =====
 Cara mendefinisikan variabel di bash script sebagai berikut. Cara mendefinisikan variabel di bash script sebagai berikut.
  
-==== Variable berisi string ====+==== Variable berisi string ====
  
 <code> <code>
Line 73: Line 84:
 Salahudin Salahudin
 </code> </code>
 +
 +==== - Variable berisi Perintah ====
 +Berikut ini adalah contoh variable berisi perintah untuk menampilkan tanggal
 +
 +<code>
 +nano variabel2.sh
 +</code>
 +isi dengan
 +<code>
 +#!/bin/bash
 +tanggal=$(date)
 +echo $tanggal;
 +</code>
 +jalankan dengan
 +<code>
 +sh variabel2.sh
 +</code>
 +output 
 +<code>
 +Wed Feb 22 09:30:11 UTC 2017
 +</code>
 +Untuk perintah dasar linux lainya bisa anda pelajari disini [[linux:perintah-dasar]]
 +
 +
 +<nspages -h1 linux:bash -textPages="Subcontent" -exclude:sidebar -exclude -simpleList>
 +<nspages -h1 -textPages="Related" -exclude:sidebar -exclude -simpleList>
 +
  
  
-===== Contoh Kode Bash ===== 
-<nspages linux:bash> 

Layanan

Harga Domain .COM | Harga Domain .ID | Shared Hosting | Email Hosting | MySQL Hosting |
linux/bash.txt · Last modified: 2021/09/23 19:05 by kbadmin

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki