Sip! makasi buat penjelasannya mas.
On Feb 18, 2013 7:22 PM, "Wardi" <[email protected]> wrote:
> On Mon, Feb 18, 2013 at 12:28:36PM +0700, Muhfi Asbin Sagala wrote:
> > Salam,
> > Aku kemarin bongkar-bongkar script bash dan ketemu variabel :
> > BASEDIR=${BASEDIR:-"$HOME"}
> >
> > Kalau di "echo" keluar "/home/user"
> > Kira-kira di variabel itu, tanda colon (titik dua) dan garis
> > penghubung berfungsi sebagai apa ya? kesannya variabel ini kayak
> > rekursif gitu.
>
> jika variable sebelah kiri :- terset dan tidak empty, maka nilainya
> yang akan direturn, sebaliknya nilai sebelah kanan :- yang akan return
>
> setelah melewati baris tersebut jika $BASEDIR sebelumnya sudah ada
> nilainya dan
> tidak empty maka akan dipertahankan, jika sebaliknya nilai $HOME yang
> akan dimasukkan ke BASEDIR
>
> contoh yang lebih sederhana misalnya menjalankan command-command berikut
> ini secara berurut pada shell bash:
> babon=ASU
> anak=kirek
> echo ${babon:-"$anak"}
> unset babon
> echo ${babon:-"$anak"}
>
> man 1 bash # kemudian search :-
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "Medan Linux Community Conference" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>
--
---
You received this message because you are subscribed to the Google Groups
"Medan Linux Community Conference" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.