Bash array to function
Hi!
How can I manipulate an array in BASH? For example. After the call of function a I want the first element in the array to have been removed. So the output after the call should be b c. Code:
#!/bin/bash |
What exactly are you trying to do? $1 is not an array variable. You would delete an array index with 'unset array[0]'. And then the function doesn't get you much, as it's a one token reference to a one token command.
|
Quote:
In the example above I'm trying to remove the first element from the array named array. |
Quote:
Code:
bash 3.2.25(1)$ array=( "a" "b" "c" ) |
Thanks! =)
|
Quote:
the next time you run a array nothing will happen (you'll have no more ${array[0]} element. |
All times are GMT -5. The time now is 12:30 AM. |