[help]Ada yang bisa bantu? tolong di bantu

Pertanyaan umum seputar distribusi Ubuntu yang menjadi distro wajib members ubuntu-indonesia.com
Post Reply
User avatar
saladdin
Posts: 13
Joined: 18 Nov 2014, 22:26

[help]Ada yang bisa bantu? tolong di bantu

Post by saladdin » 18 Nov 2014, 22:30

Bagaimana mengubah semua huruf depan menjadi kecil di dalam sebuah dalam sebuah file menggunakan terminal?
misal : file c
isinya laboratorium jaringan komputer
tampilan Laboratorium Jaringan Komputer
saya otak-atik pakai sed,tr tetap tidak ketemu jalan pintasnya. tolong di bantu para mastah


User avatar
EKOSUHARTONO
Posts: 9
Joined: 26 Sep 2012, 12:27
Location: Nganjuk, Indonesia
Contact:

Post by EKOSUHARTONO » 18 Nov 2014, 23:10

tolong diperjelas lagi pertanyaannya, ini file yang dimaksud di nautilusnya atau di office ???


User avatar
saladdin
Posts: 13
Joined: 18 Nov 2014, 22:26

Post by saladdin » 19 Nov 2014, 06:53

di linux pak, tepatnya lewat terminal. mohon bantuannya mastah


User avatar
ususbuntu
Posts: 199
Joined: 09 Apr 2010, 15:11

Post by ususbuntu » 19 Nov 2014, 09:42

Maksudnya change case seperti ini ?
lowercase

Code: Select all

$ string="A FEW WORDS"
$ echo ${string,}
a FEW WORDS
$ echo ${string,,}
a few words
$ echo ${string,,[AEIUO]}
a FeW WoRDS

$ string="A Few Words"
$ declare -l string
$ string=$string; echo $string
a few words
uppercase

Code: Select all

$ string="a few words"
$ echo ${string^}
A few words
$ echo ${string^^}
A FEW WORDS
$ echo ${string^^[aeiou]}
A fEw wOrds

$ string="A Few Words"
$ declare -u string
$ string=$string; echo $string
A FEW WORDS
Toggle

Code: Select all

$ string="A Few Words"
$ echo ${string~~}
a fEW wORDS
$ string="A FEW WORDS"
$ echo ${string~}
a fEW wORDS
$ string="a few words"
$ echo ${string~}
A Few Words
Title case

Code: Select all

$ string="a few words"
$ string=($string)
$ string=${string[@]^}
$ echo $string
A Few Words

$ declare -c string
$ string=(a few words)
$ echo ${string[@]}
A Few Words
Ubah isi file

Code: Select all

$ echo "laboratorium jaringan komputer" | tee test.txt
$ while read line;do string=$line; done <test.txt
$ string=($string)
$ string=${string[@]^}
$ echo $string | tee test.txt


User avatar
saladdin
Posts: 13
Joined: 18 Nov 2014, 22:26

Post by saladdin » 19 Nov 2014, 13:25

Terima Kasih mas sangat membantu bantuannya
ada lagi mas, ini terakhir cara menghilangkan kata seperti di bawah ini gimana ya? terima kasih sudah membantu mastah
1. file isi=
Linux
adalah
sebuah
sistem
operasi
tampilkan: adalah
sebuah
sistem
dengan penggunaan grep ?
2. Penggunaan Coloring awk?


User avatar
nif
Posts: 2818
Joined: 31 Mar 2011, 07:48

Post by nif » 20 Nov 2014, 08:40

@saladdin :
ini tugas sekolah/kuliah ya? :D

kalo gitu saya bantuin googling aja deh;
http://www.thegeekstuff.com/2009/03/15- ... -examples/
http://stackoverflow.com/questions/6540 ... ent-fields


User avatar
saladdin
Posts: 13
Joined: 18 Nov 2014, 22:26

Post by saladdin » 20 Nov 2014, 19:57

makasih bang bang, membantu :) terima kasih banyak


Post Reply

Who is online

Users browsing this forum: No registered users and 16 guests