Search Results

Search: Posts Made By: jhilmil
4,264
Posted By vbe
That said ever considered using ps with UNIX95...
That said ever considered using ps with UNIX95 option?
look at the output of for CPU:

UNIX95=1 /usr/bin/ps -e -o pcpu,args | /bin/sort -u -r | sed -e 's/\.[0-9][0-9]/&\%/g' | sed -n 2,6p
...
7,349
Posted By Don Cragun
Try changing '$file_extn' in your find command to...
Try changing '$file_extn' in your find command to "$file_extn".

Note that if there are any spaces, tabs, or newlines in any of the matched filenames, this may produce ambiguous output in $LOGFILE....
8,495
Posted By Corona688
Or even just: while IFS=" " read -r dir do...
Or even just:

while IFS=" " read -r dir
do
find "$dir" -type d ! -name . -prune -o -mtime +$NUM_DAYS -name '*.dat' -exec command_to_run_for_each_file '+'
done < dirlist_1.txt
7,349
Posted By alister
I was refining my recommendations when you posted...
I was refining my recommendations when you posted your reply. Apologies for the mismatched post/quote.

Regards,
Alister
7,349
Posted By elixir_sinari
read -r reads raw. If backslash escape sequences...
read -r reads raw. If backslash escape sequences occur in your input, they will not be interpreted. E.g., if the input has \n, it will be treated as \n and not as a new-line. You'll get the input as...
7,349
Posted By alister
Don, is there a reason to not simply override IFS...
Don, is there a reason to not simply override IFS in read's environment? Also, I may be overly paranoid, but I use -r to defend against backslashes.
while IFS= read -r dir ...

Regards,
Alister...
7,349
Posted By Don Cragun
There are several ways to do this. Assuming...
There are several ways to do this. Assuming there are no whitespace characters in any of the directory names in the list of directories in your text file, the following is probably the shortest:...
7,349
Posted By alister
You could read the paths from the file using a...
You could read the paths from the file using a while loop. Then call find once per path, substituting the value read into the find command twice, as the path argument and the argument to the first...
Showing results 1 to 8 of 8

 
All times are GMT -4. The time now is 07:51 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy