![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| very unusual question about while | Terrible | Shell Programming and Scripting | 3 | 08-16-2006 02:21 AM |
| pleaseee help with unusual crontab problem | amon | SUN Solaris | 4 | 05-10-2006 02:18 AM |
| unusual function refrences | xbjxbj | High Level Programming | 11 | 02-22-2005 02:52 AM |
| unusual function refrences | xbjxbj | UNIX for Advanced & Expert Users | 1 | 02-10-2005 12:27 AM |
| Deleting an unusual file | scmay | Shell Programming and Scripting | 2 | 06-09-2004 10:01 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
i'm a relative newbie to unix (i'm on OSX) and i have a specific problem i'm tripped up on:
i'm piping the output of top (in log format) into an awk command which formats the information (and eventually will send it out continuously via udp/osc to another app). my problem is with what comes up in the terminal when i try running top -l1000 | awk -f filterfile. the samples pop up two at a time! i need for them to be at relatively constant intervals for this application. does anyone know why this might be happening? i've included my (simple and kludgy) awk file below. thanks in advance for any help. ---- $1 !~ /Processes:|Load|SharedLibs:|MemRegions:|PhysMem:|VM:|PID/ && $2 !~ /Window|AOL|awk|top|tcsh|login|lookupd|AppleSpell|iChatAgent|UniversalA|SystemUISe|pbs|DirectoryS|log inwindo|NortonMiss|cron|cupsd|inetd|automount|nfsiod|coreservic|netinfod|crashrepor|mDNSRespon|syslo gd|autodiskmo|NortonAuto|ATSServer|SecuritySe|configd|dynamic_pa|update|kextd|mach_init|init|kernel_ tas|fix_prebin|Norton|NortonMiss|SecurityAg|SETI@home_|SETI@homeI|S@hScreenS|System|CPU|Internet|DVD |Audio|Echo24|SuperColli|scsynth|MaxMSP|MIDIServer|Image|Key|Burning|Sloppy|Adobe/ { print $2, $3, $5, $6, $7 } $2 ~ /Window|AOL/ { print $2$3, $4, $6, $7, $8 } $2 ~ /MaxMSP/ { print $2, $4, $6, $7, $8 } $2 ~ /Norton|Image|System|CPU|Internet|DVD|Audio|Echo24|Key|Burning|Sloppy|Adobe/ && $3 ~ /Caps|Ant|Pre|Capt|Monito|E|Player|Hija|Con|Mo|Sok|Phot/ { print $2$3, $4, $6, $7, $8 } |
|
||||
|
my cat does have -u but it's doin some odd things here. really doesn't change the way anything looks.
"top -l4 -s1" posts 1 sample a second. "top -l4 -s1 | cat -u" posts 2 samples every 2 seconds. "top -l4 -s1 | awk -f myfile" still posts 2 samples every 2 seconds. oddly enough, adding cat -u to the end of my command causes it to wait until all of the samples have gone through before it posts anything. so "top -l4 -s1 | awk -f myfile | cat -u" waits four seconds and then posts all four samples at once. it's interesting to see these differences. a little frustrating too, but interesting. =) could this be some buffering in the pipe? |
|
||||
|
i wound up making a script that just loops the command for each sample. works well enough.
thanks for your help! |
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|