1
vote
2answers
146 views

get arguments passed and put it in an array

is there a way to make the arguments passed become the element of an array? I want to access those arguments individually through array. like this: ./script.ksh arg1 arg2 arg3 then it will become ...
1
vote
2answers
50 views

Is this an array?

I'm currently looking at an existing script that have something like this: variable='val1 val2 val3 val4' Is this another way of setting an array? If not, what is it?
1
vote
1answer
66 views

Count number of elements in an array

I would like to ask if there is a way to count the number of elements in an array in ksh.
5
votes
1answer
128 views

Find all users who have more than N processes and echo them in shell

I'm writing a script in ksh. I need to find all users who have more than N processes and echo them in the shell. N is read from ksh. I know that I should use ps -elf, but how do I parse it, find ...
5
votes
2answers
3k views

What is the most correct way to pass an array to a function?

Consider I have a very large array $large_list, is there a way to write a function that will take the array as an argument? For example: echo_idx_array () { arr="$1" idx="$2" echo ...