x=${#custom_prompt[*]}


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers x=${#custom_prompt[*]}
# 1  
Old 06-03-2011
x=${#custom_prompt[*]}

x=${#custom_prompt[*]}

Can anyone help me in understanding the above statements meaning????

Thanks in advance,
Puru
# 2  
Old 06-03-2011
It likely is part of a script.... ( I am guessing here....)


It is a statement that finds the number of elements in an array....meaining

create a file test.sh and write in it :

Code:
custom_prompt[0]=5
custom_prompt[1]=3
custom_prompt[2]=8
x=${#custom_prompt[*]}
echo $x

It will give you '3'


then ,

Code:
#chmod 700 test.sh ; ./test.sh

delete the first line from the file and run it again.


it will give you '2'...

Have Fun

MM
# 3  
Old 06-03-2011
MySQL x=${#custom_prompt[*]}

Thanks for the explanation. Got it!!!!
 
Login or Register to Ask a Question

Previous Thread | Next Thread
Login or Register to Ask a Question