============= Shell parameter passing ======================================
P2
[Soflib @ localhost ~] $ Cat ARGs
Echo $ # arguments passed
Echo Arg 1 =: $1, Arg 2 =: $2, Arg 3 =: $3
[Soflib @ localhost ~] $./Args A B C
3 arguments passed
Arg 1 =: A, Arg 2 =: B, Arg 3 =: c
[Soflib @ localhost ~] $./Args x *
1 arguments passed
Arg 1 =: x *, Arg 2 =:, Arg 3 =:
[Soflib @ localhost ~] $
P3
[Soflib @ localhost ~] $ Cat arg2
Echo $ # arguments passed
Echo they are: $ *:
[Soflib @ localhost ~] $./Arg2 A B C
3 arguments passed
They are: a B C:
[Soflib @ localhost ~] $
P4
[soflib @ localhost ~] $ Cat m1.c
main () {
printf ("begin/N");
}< br> [soflib @ localhost ~] $ VI m2.c
[soflib @ localhost ~] $ Cat m2.c
# include
main () {
prinf ("OK! /N ");
}< br> [soflib @ localhost ~] $ VI Biao
[soflib @ localhost ~] $ Cat Biao
CAT $1 $2 | WC-L
[soflib @ localhost ~] $ Chmod + x Biao
[soflib @ localhost ~] $./Biao m1.c m2.c
7
[soflib @ localhost ~]