i want to write a script which suppose to show the processes with the desired parameter
for example if the user want the processes with memory usage of 600kb and greater the user should pass 600 as a parameter(which is x) and this script suppose to show the following :
process_2
process_3
process_4
process_5
Note: my command is : ps -efo somthing | grep somthing | grep somthing
it is a very very long command which i can't remember right now XD
so the guys helped me with the x thing and it was working fine to me
that was the porpuse of the x
now i have ran the shutdown_script by using for loop on each proccess came out from the final command which is
process_2
process_3
process_4
process_5
(the ones >=600 kb)
Note: final command is : ps -efo somthing | grep somthing | grep somthing | awk -vx=$x '$1>=x{print $NF}'
by running the following
so the processes was shutted down successfully but i had another problem
i want to do another loop that running another script which is
(start_script) on each process i did shutdown but the problem is the process does not exist by running "ps -efo" since it was killed
so i came up with temp file or variable or whatever so the temp will save the processes that i did shutdown by save them in a temp file/variable before shutting them down, and then reuse them again in the starting loop using (start_script)
Last edited by Portabello; 06-05-2011 at 06:22 PM..
thanks alot tuku i'v already done this before but there is a problem of the output of the command. The processes does not show up line by line it is appeared as a single line, for example if i do the following
it will show the processes as
process_2 process_3 proccess_4 process_5
instead of showing them line by line
process_2
process_3
process_4
process_5
Hi,
I am working on a script where I am adding adding colors to few of the info in the output.
Now , after that is done , I see colour codes in log files which I don't want to see.:mad::mad::mad::mad:
So , I tried using sed command in script as below which gives me o/p (new.log) as blank file... (7 Replies)
Hi,
i need help with a file creation of an output program. I've got a program that with #find creates an output for each files in a directory.
If i give this command :
-o spec$(date -u +%Y%m%dt%H%M)
it creates just one file, overwriting all the others since it is the creation date .... (2 Replies)
I have been trying this program for a long time. I am trying to read a file named "odon" line by line; read the first line, send it to do a command saved in a file "perm", once the first line has finished going through the content of the file perm, the result is saved with the number of the line.... (17 Replies)
Hi all........
Plss do help me.......in a big trouble... :wall::wall::wall:
I have 3 directories named as :1. /home/shuchi/source
2./home/shuchi/destination
3./home/shuchi/filter
now the problem is /home/shuchi/source has say 2 files with extension .txt as given below :
A.txt
msisdn ... (5 Replies)
Hi all........
Plss do help me.......in a big trouble... :wall::wall::wall:
I have 3 directories named as :1. /home/shuchi/source
2./home/shuchi/destination
3./home/shuchi/filter
now the problem is /home/shuchi/source has say 2 files with extension .txt as given below :
A.txt
Code:
... (0 Replies)
I am ssh to many servers to get some information... however sometimes the server is unreacheable and i am getting an error. I want to save that output to a file but I am not able to do so...
I want to be able to save output of bash into a file.. so when I run this command on a script
ssh... (5 Replies)
hi
I have a script to login from a host "A" to a list of hosts in a file and perform some commands inside it...its somethin like this
for i in `cat file`
do
ssh -t $i " command1 ; command2; ..."
done
I wanna save the outputs in a file in the current host "A" i.e from where I am... (3 Replies)
Hello,
I have a shell script containing a command string in the following format:
command1 | command2 | cut -c9-16
The output from this is a record number (using characters 9-16 of the original output string) e.g. ORD-1234
I wish to save this value to a variable for use in later commands... (4 Replies)
How would I pass awk output to a perl variable?
For example, I want to save the value in the 4th column into the variable called test. My best guess is something as follow, but I am sure this isn't correct.
$test = system("awk '/NUMBER/{print \$4}' $_"); (8 Replies)
I have 2 files. File 1 exports variables globally, File 2 pulls in the information into itself and displays it. I need to know how to then save the information into the bottom of File 2, allowing for more information to be added at a later date.
The scripts i've written are below.
File 1:... (8 Replies)