Skip to content

Instantly share code, notes, and snippets.

@moznion
Created March 18, 2013 16:37
Show Gist options
  • Select an option

  • Save moznion/5188603 to your computer and use it in GitHub Desktop.

Select an option

Save moznion/5188603 to your computer and use it in GitHub Desktop.
#!/bin/bash
array=('one' 'two' 'three' 'four')
opt_name='--exclude'
opts=''
for elem in ${array[@]}; do
opts=$opts$opt_name' '$elem' '
done
echo $opts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment