Bash scripting questions:
1. Is the $# var not global? I can't seem to access it from within functions() in my script.
2. What is the difference between (( expression )) and [[ expression ]] my tutorial states that they are opposites however (( 5 > 9 )) evaluates to 1 (false) which is same with [[ ]] |
iirc, historically [[ ]] came first, for logical ie if/then tests.
(( )) came later in ksh and bash for 'built-in' arithmetic calcs, to avoid calling another (external) util eg expr. However, (( )) will also return a true/false equiv under certain conditions (as per your example). HTH |
Quote:
|
you could do it by passing the scripts args again to the function
func "$@" though of course they are now local to the function so any changes made to the args will not propogate backwards to the caller so a waste of time really |
All times are GMT -5. The time now is 06:43 PM. |