![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Error to "find" a matching array element in a directory | mkbaral | Shell Programming and Scripting | 1 | 09-30-2008 02:06 PM |
| "find command" to find the files in the current directories but not in the "subdir" | swamymns | Shell Programming and Scripting | 9 | 07-22-2008 12:23 PM |
| Explain the line "mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`" | Lokesha | UNIX for Dummies Questions & Answers | 4 | 12-20-2007 01:52 AM |
| grep to find content in between curly braces, "{" and "}," | keshav_rk | Shell Programming and Scripting | 4 | 08-09-2007 11:14 PM |
| wrinting "ls" results on 1 line.... | Nicol | Shell Programming and Scripting | 5 | 11-09-2004 05:42 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Results of "find" to an array
I am looking to search a directory for a folder or file and when it finds any hits I want it to store those hits in an array so I can work with those hits later on. I have been trying to do something like this but it isn't putting results into an array like I would like, is it syntax or is this not possible? Code:
TARGET="MyRoot"
START_PATH="/Users/rtipton/Desktop/"
PATH_COUNT=0
find "$START_PATH" -type d \( -iname "$TARGET" \) -exec PATH_RESULTS[PATH_COUNT=$PATH_COUNT+1]=`echo {}` \;
Any ideas? Rob |
| Bookmarks |
| Tags |
| shell script, shell scripting, unix scripting, unix scripting basics |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|