![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | 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 here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| consumption memory | tagger | AIX | 9 | 10-10-2008 11:34 PM |
| Ghost Process + CPU consumption | neal.opperman | SCO | 1 | 02-14-2008 01:53 AM |
| Memory Consumption Commands | siebeladmin | HP-UX | 2 | 07-29-2006 10:06 AM |
| CPU consumption | pleaseteachmeun | UNIX for Advanced & Expert Users | 3 | 02-17-2006 08:56 AM |
| Memory consumption of threads | Fong | AIX | 0 | 08-02-2005 08:56 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
hi,
i hav a script which processes 1000 files one by one in every run jus for searching their corresponding output files at a given path, due to this my script runs for long time and taking more CPU, can we have any way in which we can have this check at least 100 files in a single shot instead of one by one by a simple loop, and how will it affect the CPU consumption. Thank You |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
Kindly repost in English, and with your script provided inside [code] tags.
|
|
#3
|
|||
|
|||
|
In the below mentioned script :
[#!/bin/ksh Home="/tmp/Text" Path="/abc/def" find $Path -mtime -1 -print | xargs ls -ld > $Home # Putting latest 24 hours files in $Home cat $Home | while read line do File=$(echo $line|awk '{print $4}'); if [[ -f "$File.SP" ]] then echo " File $File is Correct" else echo "File $File is Missed" fi ] i am checking for the files which are received in last 24 hours( almost 1000 files) in my system and they have their corresponding ".SP" file generated, if not then its a MISS. Here i am checking 1000 files one by one that their corresponding ".SP" is generated or not. can i have any way common by which i can put this check for more than a file at a time, to minimize the run time of the script? i mean can we parallely run multiple checks like threading?? |
|
#4
|
|||
|
|||
|
Code:
find /abc/def -not -name '*.SP' -exec ./helperscript.sh {} \;
Code:
if [ -e $1.SP ]; then echo "File $1 is Correct"; else echo "File $1 is Missed"; fi |
|
#5
|
|||
|
|||
|
sir,
thank you so much for your help, i am novice to unix, it would be great if you can tell me how i have to write it in my code. i mean, can i call one script in other if yes how i have to that? please give me an example thanks again |
|
#6
|
|||
|
|||
|
At the risk of sounding flippant, why do you have the access or the requirement to do this task if you lack the expertise?
|
|||
| Google The UNIX and Linux Forums |