2
votes
2answers
153 views

Creating an array with IFS set to a different value

I am trying to construct an array and write to a file in this format, i.e. the file's content should be something like this hero_pairscore=( askdjfh sdf,sdlkfj lksf,dfgdf,dsflkgj,asdlkf ....) Where ...
1
vote
1answer
65 views

Is there a simple way to get array of all arguments that do not begin with a hyphen?

zsh includes a powerful utility for parsing command-line options zparseopts, but for quick shell scripts and shell functions, but is there an easy way to extract the array of all command-line ...
1
vote
1answer
251 views

Problem with sed on a array containing strings containing spaces

I have a array looking like this: array=("(1 2 3) (123)" "2 31 (231)" "4 5 1 (451)" "(te)xt (1234)") This array is a example. It does not look like this but its structure is the same (the strings ...
2
votes
1answer
898 views

Array of string expanded to path?

Suppose I have the following initialization of bash array: my_array=( "/usr/bin" "/usr/lib/*.so" ) If I do iteration using: for array_item in ${my_array[@]} do ... done Then the ...