halo smua,
saat ini saya sedang belajar bash scripting.
pada salah satu tugas latihannya adalah tentang variable jenis array,
http://www.tldp.org/LDP/Bash-Beginners-Guide/html/sect_10_05.html
saya kesulitan dalam memanipulasi urutan data yang di masukkan ke dalam
variable jenis array tersebut.
script saya:
#!/bin/bash
#
# display_it.sh
# This script will display... err..well, im not finish it yet :)
declare -a ARGM
echo "This script you are using is: $0" | sed 's/.\///'
echo "You passed $# argument(s)."
while (( $# )); do
echo $1
ARGM[$#]=$1;
shift
done
echo "Your argument are : ${ARGM[*]}"
nah ketika di jalankan:
[EMAIL PROTECTED]:~/doc/bash$ ./tmp.sh one two three four five
This script you are using is: tmp.sh
You passed 5 argument(s).
one
two
three
four
five
Your argument are : five four three two one
[EMAIL PROTECTED]:~/doc/bash$
apakah bisa data dari array tersebut di masukkan sesuai dengan urutan
argumennya di berikan, sehingga hasil cetaknya :
Your argument are : one two three four five
saya sudah mencoba berbagai cara yang saya tau, tapi belum ketemu
solusinya :D
saya harap ada yang bisa berikan solusi,
trims
Money can't buy love, but it improves your bargaining position. --
Christopher Marlowe
http://rizahnst.afraid.org/
--
Berhenti langganan: [EMAIL PROTECTED]
Arsip dan info: http://linux.or.id/milis