Linux tips and tricks
Showing posts with label
join
.
Show all posts
Showing posts with label
join
.
Show all posts
Saturday, May 3, 2014
Bash - Join Arrays
How to join arrays in Bash Script? Very simple :) Example:
#!/bin/bash
a1=(a b c d) #array 1
a2=(e f g h) #array 2
a=(${a1[@]} ${a2[@]}) #join array
echo ${a[@]}
Output is:
a b c d e f g h
Make array of arrays and result is joined array :)
Older Posts
Home
Subscribe to:
Posts (Atom)