Redirection

Hello All,

I am using the below script to gather various tools running by the user, we have more than 100 tools running on the server so my challenge is to redirect memory & cpu load to the file with the name of the tool.so am using the below script i am stucking how to redirect to the file using variable $inpuline.

while read inputline
do

    ps -auxf |grep $inputline| sort -nr -k 4 | head -10

    ps -auxf |grep $inputline| sort -nr -k 3 | head -10

#    pkill $inputline

done<tools

KIndly let me know.

REgards
Ankit

tools file contains process names , is it true?
do you want output to redirect to file if is u maybe can try this

ps -auxf |grep $inputline| sort -nr -k 4 | head -10 >${inputline}_mem
ps -auxf |grep $inputline| sort -nr -k 3 | head -10 >${inputline}_cpu

I also got it,

Thanks anyways.

REgards

Ankit