#!/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
Jelas saja, kan
ARGM[$#]=$1;
jalannya dari belakang (pertama: $# = 5, kedua: $# = 4, ...).
--
Berhenti langganan: [EMAIL PROTECTED]
Arsip dan info: http://linux.or.id/milis