Article 52G9Q LXer: Brace expansion with variables and arrays: eval to the rescue

LXer: Brace expansion with variables and arrays: eval to the rescue

by
LXer
from LinuxQuestions.org on (#52G9Q)
Published at LXer:

In a 2019 blog post I tinkered with two alternatives to BASH brace expansion. Alternatives might be needed because strings with spaces cause problems unless separately quoted, and (I thought) you can't put shell variables inside the braces because BASH does brace expansion first when executing a command. But with the help of eval, a BASH built-in, you can brace-expand variables with ease, and a simple conversion lets you brace-expand BASH arrays.

Read More...latest?d=yIl2AUoC8zA latest?i=IGgw3qsHpdI:3U7AYPxjl-c:F7zBnMy latest?i=IGgw3qsHpdI:3U7AYPxjl-c:V_sGLiP latest?d=qj6IDK7rITs latest?i=IGgw3qsHpdI:3U7AYPxjl-c:gIN9vFwIGgw3qsHpdI
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments