Unfortunately, when I do that in a script, when I run my next command, could be just an 'ls -l' it says that the process stops and it doesn't write to the test.txt file anymore.
I guess the first part isn't as big of a deal, b/c if needed I can just run this script every morning and leave the putty window open.
The biggest part, is the output of the file. When I do a 'more test.txt' on it, I can page through and get my results one page at a time, but that's not what I want.
Do that command and you'll see what I mean, especially if I do a view on it, then it's formatting is really horrid.
The top part of it is fine if it's just there once, but then the last line
I just want the header once(or not at all) and then just a listing of the below line whenever a value for the pid I specify is changed.
One last thing that would be nice is that there is a /path/to/pid/file/processFile.pid that contains just the process id I need. Is there any way I can capture that and put that in to a script, that way this can be a dynamic script as well?
Okay, after playing around some, I got the last part.
So now my real issue is when I run it in the background, after I type another command this is what happens:
Then it says it's still running when I do a ps -ef | grep testing.sh, but nothing is being written to the testing.txt file
There are different variants of top but you want the batch option (this is -b on my system) and apparently you want to run it in the background. I'm sure you have the manual page on your system, where you can look up the details on how to specify what output formatting to use.
There are different variants of top but you want the batch option (this is -b on my system) and apparently you want to run it in the background. I'm sure you have the manual page on your system, where you can look up the details on how to specify what output formatting to use.
That's actually exactly what I want, except it still gives me the headers each time. Is there anyway to get rid of that?
Hi,
Is there a way to redirect the output of a set of commands to a file instead of using << at every command in bash shell. For eg
(echo hostname
echo "Comparing 2 files"
comm -3 file1 file2) >>file3 (3 Replies)
Hi ,
i am having an file which contains 5 file_name data, i need to read the file name and will perform certain operation and generate out file names with named as 5 individual file_names
for eg:
file.txt contains
file_name1.txt|hai
file_name2.txt|bye
file_name3.txt|how... (3 Replies)
Okay, I am trying to come up with a multi-platform script to report top ten CPU and memory hog processes, which will be run by our enterprise monitoring application as an auto-action item when the CPU and Memory utilization gets reported as higher than a certain threshold
I use top on other... (5 Replies)
hi i have two file
a.txt
123,b,c,d,e
111,c,d,e,f,
456,a,k,j,h
b.txt
123
678
987
321
456
i want to compare these two files(match content of b first coloum with a ) and o/p should be like
123,d,e
456,j,h
pls help.....:) (7 Replies)
Hello,
I am New to Unix.
I am Using HP-UX 9000 Series for my Application.
I am Currently Facing an Issue that the error messages are being written in the syslog file instead of the Application Log File. The Codes for that Syslog.h is written in Pro*C.
I want to know how to Redirect these... (3 Replies)
Hello all
im trying to use top program in my csh shell
like this :
set topResult = `top | grep server.exe`
but im facing 2 problems
1.when the top program dont installed in the machine im getting error
so can i check in csh if application im using exist
2 the top program gives... (2 Replies)
Ahhhrrrggg I'm having a brain fart...
I want to take the output of a command and redirect it to a file...
This works....
$ man cp | cat >> copy_help
but this doesn't
keytool -help |cat >> keytool_help
It just produces... these lines...
more keytool_help
] ...
... (11 Replies)