You want to do an eval.
$ foo={a,b,c}
$ mkdir -p test/$foo
$ find test
test/
test/{a,b,c}
$ eval mkdir -p test2/$foo
$ find test2
test2/
test2/a
test2/b
test2/c
$ man bash | less -iX '+/\beval\b'
The reason is because of the way bash does expansion:
$ man bash | less -iX '+/^EXPANSION'
Regards,
- Robert
On Mon, Sep 1, 2008 at 11:38 AM, kurumim007 <[EMAIL PROTECTED]> wrote:
> I need to declare a variable in mkdir command
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Linux Users Group.
To post a message, send email to [email protected]
To unsubscribe, send email to [EMAIL PROTECTED]
For more options, visit our group at
http://groups.google.com/group/linuxusersgroup
-~----------~----~----~----~------~----~------~--~---