Timeline for How to set up a pre-defined variable with multiple directory paths to use with the find command
Current License: CC BY-SA 3.0
6 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jan 8, 2016 at 23:17 | comment | added | Gilles 'SO- stop being evil' | @Simply With quotes around the value and spaces between values, you aren't defining an array, you're defining a string variable. If you then use an unquoted expansion (find $DIRLIST), which is the “glob+split” operator, that works for you, provided the directory names don't contain spaces or \[*?. | |
| Jan 8, 2016 at 23:16 | history | edited | Gilles 'SO- stop being evil' | CC BY-SA 3.0 | added 2 characters in body |
| Jan 8, 2016 at 8:26 | comment | added | gardenhead | Actually it should be "${DIRLIST[@]}". If you don't quote the variable, then word splitting will be performed on the array values. | |
| Jan 8, 2016 at 6:44 | comment | added | Simply | Array Variable! That is what I was looking for. This helped greatly, thank you! As I have multiple arrays specified, I didn't need to use the wildcard. Also, its an older version of AIX ( yay corporate red tape) so I used single quotes as opposed to the parens. Got it working. | |
| Jan 8, 2016 at 5:31 | history | edited | linerd | CC BY-SA 3.0 | added 1 character in body |
| Jan 8, 2016 at 5:23 | history | answered | linerd | CC BY-SA 3.0 |