![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | 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 and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| get output in each cell from shell script | sophos | Shell Programming and Scripting | 3 | 04-23-2009 10:40 PM |
| have a shell script done in pl/sql and want output in html | arobert | Shell Programming and Scripting | 2 | 12-13-2008 01:56 AM |
| Shell Script Output | sharpi03 | Shell Programming and Scripting | 4 | 09-20-2008 12:16 AM |
| Shell script getting input from output | aspect_p | Shell Programming and Scripting | 1 | 03-11-2008 07:37 AM |
| redirecting SQL output from within a shell script | soliberus | Shell Programming and Scripting | 2 | 11-23-2007 08:29 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
[How To?] Run shell script and get output into another shell.
Hi guys, I have a simple question, I want to store the output of the following command: Quote:
I just want to store these new lines into a single variable, so I can use it into a script. To clear the screen, and do not print lines after the others when iotop is running just delete "- C". I DO NOT WANT TO STORE THE OUTPUT ON THE DRIVE!!! I DO NOT WANT TO KILL IOTOP, IT MUST BE RUNNING ALL THE TIME IN BACKGROUND!!! The idea is to do not write on the drive! Just store the output into a single variable called $Activity. For example: Code:
Activity=$(sudo iotop -t 0 3 | grep "load: ") & While $Activity... do blahblah... done But the fact is that nothing can be stored into Activity ![]() So I have tried to know if something can be done to read the last output of a specified PID. But I need help on that point too :-/ I don't know how to do it. Please help... ![]() ---------- Post updated at 09:57 AM ---------- Previous update was at 02:02 AM ---------- Ok, here is my code: Code:
sudo iotop -t 0 -C 3 | grep "load: " | script.sh script.sh: Code:
#!/bin/sh
while read data
do
echo "[$(date +"%D %T")] $data" >> log_activity.txt
done
But nothing is read
|
| Bookmarks |
| Tags |
| activity, drive, pid, variable |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|