Laporan sementara shell programming bab input/output

adysha@adysha-laptop:~$ ls –l
total 664
-rw-r–r– 1 adysha adysha     29 2010-10-07 00:26 a
-rw-r–r– 1 adysha adysha 290494 2010-09-29 22:08 bab3tm.pdf
-rw-r–r– 1 adysha adysha 246000 2010-09-29 22:17 bab4tm.pdf
drwxr-xr-x 2 adysha adysha   4096 2010-10-07 00:42 Desktop
drwxr-xr-x 2 adysha adysha   4096 2010-09-06 01:22 Dokumen
drwx—— 4 adysha adysha   4096 2010-09-25 23:56 Elektro Digital  2
-rw-r–r– 1 adysha adysha    179 2010-09-06 01:17 examples.desktop
-rw-r–r– 1 adysha adysha     75 2010-10-01 21:30 fe
drwxr-xr-x 4 adysha adysha   4096 2010-09-25 17:45 Gambar
-rw-r–r– 1 adysha adysha   4099 2010-10-07 01:19 hasil
-rw-r–r– 1 adysha adysha     44 2010-10-07 01:01 kelas1.txt
-rw-r–r– 1 adysha adysha     31 2010-10-07 01:04 kelas2.txt
-rw-r–r– 1 adysha adysha     75 2010-10-07 01:05 kelas.txt
-rw-r–r– 1 adysha adysha     64 2010-10-07 02:25 ko.4
-rw-r–r– 1 adysha adysha      0 2010-10-01 21:32 m
drwx—— 7 adysha adysha   4096 2010-09-28 23:07 modul teori Semester 3
drwxr-xr-x 2 adysha adysha   4096 2010-09-06 01:22 Musik
-rw-r–r– 1 adysha adysha    128 2010-10-07 08:28 out1.sh
-rw-r–r– 1 adysha adysha     97 2010-10-07 08:28 out2.sh
-rw-r–r– 1 adysha adysha    206 2010-10-07 08:29 out3.sh
-rw-r–r– 1 adysha adysha    237 2010-10-07 08:29 out4.sh
-rw-r–r– 1 adysha adysha    114 2010-10-07 08:30 out5
-rw-r–r– 1 adysha adysha    114 2010-10-07 08:30 out5.sh
-rw-r–r– 1 adysha adysha    219 2010-10-07 08:31 out6.sh
-rw-r–r– 1 adysha adysha     85 2010-10-07 08:33 out7.sh
-rwxr-xr-x 1 adysha adysha    256 2010-10-07 08:25 out.sh
-rwxr-xr-x 1 adysha adysha     28 2010-10-07 02:13 p1.sh
-rw-r–r– 1 adysha adysha     35 2010-10-07 02:14 p2.sh
-rwxr-xr-x 1 adysha adysha     62 2010-10-07 01:22 ploop.sh
drwxr-xr-x 3 adysha adysha   4096 2010-10-07 00:42 Publik
drwx—— 2 adysha adysha   4096 2010-09-05 23:08 RE2-PDF
drwx—— 4 adysha adysha   4096 2010-10-07 02:24 Shell Programming
drwxr-xr-x 2 adysha adysha   4096 2010-09-06 01:22 Template
drwxrwxr-x 2 adysha adysha   4096 2010-09-05 18:53 Ubuntu One
drwxr-xr-x 2 adysha adysha   4096 2010-09-29 22:17 Unduhan
drwxr-xr-x 3 adysha adysha   4096 2010-09-25 17:45 Video
adysha@adysha-laptop:~$ chmod +x out1.sh out2.sh

adysha@adysha-laptop:~$ chmod +x out3.sh out4.sh out5.sh out6.sh out7.sh

adysha@adysha-laptop:~$ ./out.sh
Hello      World
Hello World
Hello * World
Hello Desktop Dokumen Elektro Digital  2 Gambar Musik Publik RE2-PDF Shell Programming Template Ubuntu One Unduhan Video a bab3tm.pdf bab4tm.pdf examples.desktop fe hasil kelas.txt kelas1.txt kelas2.txt ko.4 m modul teori Semester 3 out.sh out1.sh out2.sh out3.sh out4.sh out5.sh out6.sh out7.sh p1.sh p2.sh ploop.sh World
Hello World
Hello World
Hello       World
Hello “*” World
./out.sh: 11: hello: not found
world
hello world

adysha@adysha-laptop:~$ ./out1.sh
“Selamat belajar program bash”
“Mudah dan menyenangkan……..!”

adysha@adysha-laptop:~$ ./out2.sh
“selamat”“belajar program bash”

adysha@adysha-laptop:~$ echo -n

adysha@adysha-laptop:~$ ./out3.sh
Waktu system   :Kam Okt  7 08:46:30 WIT 2010
Anda           :adysha
Banyak pemakai :wc: –l: No such file or directory

adysha@adysha-laptop:~$ ./out4.sh
Hi, Pake printf ala C
di bash
My url pemula.linux.or.id
32 decimal = 40 octal
32 decimal dalam float = 32,00

adysha@adysha-laptop:~$ echo hello world
hello world

adysha@adysha-laptop:~$ ‘#!/bin/bash’ > my-script.sh
bash: #!/bin/bash: No such file or directory

adysha@adysha-laptop:~$ ‘#!/bin/bash’ > my-script.sh
bash: #!/bin/bash: No such file or directory

adysha@adysha-laptop:~$ echo ‘echo hello world’ >> my-script.sh

adysha@adysha-laptop:~$ chmod 775 my-script.sh

adysha@adysha-laptop:~$ ./my-script.sh
hello world

adysha@adysha-laptop:~$ echo $SHELL
/bin/bash

adysha@adysha-laptop:~$ echo -e “33[31m  hello33[0m”
hello

linux@linux-laptop:~$ ./out.sh

INI DIBARIS 3, KOLOM 20

HELLO

ANDA LIHAT INI

linux@linux-laptop:~$ ./out7.sh

HELLO

PAKE TPUT

linux@linux-laptop:~$ ./inp1.sh

–n Tuliskan nama :

hilmy

Hallo ………….hilmy

linux@linux-laptop:~$ ./inp2.sh
User Name : hilmy
Password 10 karakter,
jika dalam 6 second tidak dimasukkan pengisian password diakhiri
kesan anda selama pake linux,
_underscore=>selesai
linux so good
User = hilmy
Password = hafzoro
Kesan selama pake linux = linux so good

linux@linux-laptop:~$ ./inp3.sh
Nama anda :hilmy
Hi hilmy,  apa khabarmu
Pesan dan kesan :
sugeng dalu
kata hilmy, sugeng dalu

TUGAS
1.) #!/bin/bash

echo “what is your name?”
read nama
echo “hallo….. $nama”
touch $nama
echo “i will create you a file named $nama _file”

linux@linux-laptop:~$ ./tugas1.sh
what is your name?
hilmy
hallo….. hilmy
i will create you a file named hilmy _file
linux@linux-laptop:~$ ls –l
total 1024
drwxr-xr-x 2 linux linux   4096 2010-10-01 22:50 Desktop
drwxr-xr-x 7 linux linux   4096 2010-10-01 22:46 Documents
drwxr-xr-x 2 linux linux   4096 2010-10-01 22:50 Downloads
-rw-r–r– 1 linux linux    179 2010-10-01 22:46 examples.desktop
-rwxrwxrwx 1 linux linux     88 2010-10-08 21:36 inp1.sh
-rwxrwxrwx 1 linux linux    349 2010-10-07 10:09 inp2.sh
-rwxrwxrwx 1 linux linux    158 2010-10-07 10:10 inp3.sh
-rwxr-xr-x 1 linux linux  22528 2010-10-07 10:12 lapsem.doc
drwxr-xr-x 2 linux linux   4096 2010-10-01 22:46 Music
-rwxrwxrwx 1 linux linux     83 2010-10-07 10:00 out7.sh
-rwxrwxrwx 1 linux linux    213 2010-10-07 09:59 out.sh
drwxr-xr-x 3 linux linux   4096 2010-10-03 00:08 Pictures
drwxr-xr-x 2 linux linux   4096 2010-10-01 22:50 Public
-rw-r–r– 1 linux linux      0 2010-10-08 22:16 hilmy
-rw-r–r– 1 linux linux     45 2010-10-06 20:00 soal4.txt
drwxr-xr-x 2 linux linux   4096 2010-10-01 22:50 Templates
-rw-r–r– 1 linux linux 957664 2010-10-01 22:46 TranscodedWallpaper.jpg
-rwxr-xr-x 1 linux linux    134 2010-10-08 22:12 tugas1.sh
drwxr-xr-x 2 linux linux   4096 2010-10-01 22:50 Videos

3.) #!/bin/bash echo “i will guess your username”
echo “it is: “; whoami
linux@linux-laptop:~$ ./tugas3.sh
i will guess your username
it is:
linux

1 Response so far »


Comment RSS · TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: