Hi
I would like to call function in my script couple of times. But each time with different parameters position.
In line 57 I don't know how to call it without typing $1 and $ parameters ?
#!/bin/ksh
2
3
4 function First
5 {
6
7 # $1 - name
8 # $2 - second name
9 # $3 - age
10 # $4 - sex
11
12 typeset -r MY_NAME=$1
13 typeset -r MY_2nd_NAME=$2
14 typeset -ri AGE=$3
15 typeset -r SEX=$4
16
17
18 if [[ -n $MY_NAME && -n $MY_2nd_NAME ]]
19 then
20
21 print -n "Name is: $MY_NAME in function locally"
22 print
23
24 print -n "Second name is: $MY_2nd_NAME in function locally"
25 print
26 else
27 print "My age is: $AGE"
28 print
29
30 print "My sex is: $SEX"
31 print
32 fi
33 }
34
35
36
37
38 # Start of the program
39
40 print -n "Podaj imie: "
41 read NAME
42 print
43
44 print -n "Podaj nazwisko: "
45 read nd_NAME
46 print
47
48
49 print "Running local funtion First"
50 First $NAME $nd_NAME
51 print
52
53
54 print "Calling function First again, but now with other parameters"
55 print
56
57 First $1 $2 29 male
thx for help