Sponsored Content
Full Discussion: using find in for loop
Operating Systems AIX using find in for loop Post 302231353 by muthursyamburi on Tuesday 2nd of September 2008 07:05:08 AM
Old 09-02-2008
hi lakris,

i dont think it will suite to my situation coz,
1. i cannot use fixed values like "/home/training" & "*.sh". i hv to go for variables only.
2. i want files from the sub-dirs too and not alone the current dir(say, /home/training).
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

For Loop with find

I'm trying to write a script to archive some log files, and I'm getting a little stuck. My 'find' command by itself works great, returning all of the log files I need, but when I try to combine it with my loop, I'm getting an error. Here's what I have so far: for FILENAME in $(find . -type f... (4 Replies)
Discussion started by: kadishmj
4 Replies

2. Shell Programming and Scripting

Loop and find not working ASAP

I grep some thing from file then in a loop give to find one by one but not working. #!/bin/bash grep -H DocumentRoot /etc/httpd/conf.d/*.conf | awk -F' ' '{ print $3 }'| sort -u | uniq > path.txt for j in `cat path.txt` do # echo "line is $i" find "$j" -type d... (3 Replies)
Discussion started by: aliahsan81
3 Replies

3. Shell Programming and Scripting

Help in loop find question at STEP 3

STEP 1 # Set variable FILE=/tmp/mainfile SEARCHFILE =/tmp/searchfile cat /tmp/mainfile Interface Ethernet0/0 "outside", is up, line protocol is up Hardware is i82546GB rev03, BW 100 Mbps Full-Duplex(Full-duplex), 100 Mbps(100 Mbps) MAC address 001e.f75e.8cb4, MTU 1500 IP address... (1 Reply)
Discussion started by: irongeekio
1 Replies

4. Shell Programming and Scripting

find a string in a loop

Hi, Can anyone help with the problem below? I need to read all text files (file1, file2, file3) in a loop and find file1.txt: file2.txt: File3.txt: (7 Replies)
Discussion started by: Lenora2009
7 Replies

5. Shell Programming and Scripting

Find result using for loop

I want to print each file i found using the find command. And not able to list the files at all here is the code SEARCH_DIR="/filesinfolder"; PATH_COUNT=0 for result in "'/usr/bin/find $SEARCH_DIR -daystart \( \( -name 'KI*' -a -name '*.csv' \) -o -name '*_xyz_*' \) -mtime 1'" do... (1 Reply)
Discussion started by: nuthalapati
1 Replies

6. Shell Programming and Scripting

find in for loop

What's wrong with this script for i in Users.csv anc.csv > do > find . -name $i > doneDouble post. Continue here. (0 Replies)
Discussion started by: theshashi
0 Replies

7. Shell Programming and Scripting

find in for loop

whats wrong with this script for i in Users.csv abd.csv > do > find . -name $i > done (2 Replies)
Discussion started by: theshashi
2 Replies

8. Shell Programming and Scripting

Loop with Find—damn spaces!

Hi Guys, I'm trying to find all files with a particular extension and then loop some actions. The problem is that if the files have spaces in their names I get end up being each word as a separate result rather than the entire file. ext=".txt" out=".rtf" for i in $( find "$1" -name "*$ext" );... (9 Replies)
Discussion started by: imonkey
9 Replies

9. UNIX for Dummies Questions & Answers

find command in for loop

i have executed the following command in terminal find /Users/vasu -name "*.txt" -print and i am getting the result /Users/vasu/file1.txt /Users/vasu/file2.txt /Users/vasu/file3.txtbut while i was trying to execute the same in the script it is not working,I tried with below logic in... (2 Replies)
Discussion started by: vmachava
2 Replies

10. UNIX for Dummies Questions & Answers

While loop, input from find command

Hello nix Experts, I am a *nix rookie and have run into this issue, can some one help me here and let me know what I am doing wrong. /home/user1> while read n > do > echo $n > done < <(find . -type f -ctime -1 | grep abc) I am getting the below error: -sh: syntax error near... (5 Replies)
Discussion started by: babyPen1985
5 Replies
Advanced Traversal Helpers(3)				     Hardware Locality (hwloc)				     Advanced Traversal Helpers(3)

NAME
Advanced Traversal Helpers - Functions unsigned hwloc_get_closest_objs (hwloc_topology_t topology, hwloc_obj_t src, hwloc_obj_t *restrict objs, unsigned max) static inline hwloc_obj_t hwloc_get_obj_below_by_type (hwloc_topology_t topology, hwloc_obj_type_t type1, unsigned idx1, hwloc_obj_type_t type2, unsigned idx2) static inline hwloc_obj_t hwloc_get_obj_below_array_by_type (hwloc_topology_t topology, int nr, hwloc_obj_type_t *typev, unsigned *idxv) Detailed Description Be sure to see the figure in termsanddefs that shows a complete topology tree, including depths, child/sibling/cousin relationships, and an example of an asymmetric topology where one socket has fewer caches than its peers. Function Documentation unsigned hwloc_get_closest_objs (hwloc_topology_ttopology, hwloc_obj_tsrc, hwloc_obj_t *restrictobjs, unsignedmax) Do a depth-first traversal of the topology to find and sort. all objects that are at the same depth than src. Report in objs up to max physically closest ones to src. Returns: the number of objects returned in objs. 0 if src is an I/O object. Note: This function requires the src object to have a CPU set. static inline hwloc_obj_t hwloc_get_obj_below_array_by_type (hwloc_topology_ttopology, intnr, hwloc_obj_type_t *typev, unsigned *idxv) [static] Find an object below a chain of objects specified by types and indexes. This is a generalized version of hwloc_get_obj_below_by_type(). Arrays typev and idxv must contain nr types and indexes. Start from the top system object and walk the arrays typev and idxv. For each type and logical index couple in the arrays, look under the previously found object to find the index-th object of the given type. Indexes are specified within the parent, not withing the entire system. For instance, if nr is 3, typev contains NODE, SOCKET and CORE, and idxv contains 0, 1 and 2, return the third core object below the second socket below the first NUMA node. Note: This function requires all these objects and the root object to have a CPU set. static inline hwloc_obj_t hwloc_get_obj_below_by_type (hwloc_topology_ttopology, hwloc_obj_type_ttype1, unsignedidx1, hwloc_obj_type_ttype2, unsignedidx2) [static] Find an object below another object, both specified by types and indexes. Start from the top system object and find object of type type1 and logical index idx1. Then look below this object and find another object of type type2 and logical index idx2. Indexes are specified within the parent, not withing the entire system. For instance, if type1 is SOCKET, idx1 is 2, type2 is CORE and idx2 is 3, return the fourth core object below the third socket. Note: This function requires these objects to have a CPU set. Author Generated automatically by Doxygen for Hardware Locality (hwloc) from the source code. Version 1.7 Sun Apr 7 2013 Advanced Traversal Helpers(3)
All times are GMT -4. The time now is 01:22 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy