How do I capture multiple lines of the status output of a command?
I need to know what the upload speed of an Internet connection. I thought the easiest way to do this would be to transfer a file via FTP to my server using the command:
Note: My environment allows me to issue ONLY 1 line of code. That line of code can have multiple commands seperated by a semi-colon( ; ).
The above command works great in terminal. It uploads the file and gives me lots of text to tell me what is going on:
Quote:
230 User username logged in.
Remote system type is UNIX.
Using binary mode to transfer files.
200 Type set to I.
250 CWD command successful.
local: file_to_be_uploaded remote: file_to_be_uploaded
502 'EPSV': command not understood.
227 Entering Passive Mode (69,13,207,4,232,153)
150 Opening BINARY mode data connection for .
100% |*************************************| 905 KB 200.51 KB/s 00:00 ETA
226 Transfer complete.
927204 bytes sent in 00:05 (173.23 KB/s)
I'm after that last line in the form:
x bytes sent in mm:ss (y KB/s)
I want to obtain the value for y. I thought the way to do this would be to send the output to a text file:
Problem is, all I get in ftpupload.txt is a previous line that has some useless error on it:
Quote:
502 'EPSV': command not understood.
How can I get the contents of the last line so I know what the upload throughput is?
My issue :
I am getting only last command output data in ouput file. Though comamnd "print(output)" displays data for all 3rd column values but the data saved in file is not what required it hs to be the same which is being printed by command"print(output)".
Could you please help me to fix this,... (0 Replies)
Hi
I want to know how capture all user command line output and save this commands and outputs to text files?
if you have script for this subject please give me.:o
please help me
thank you (6 Replies)
Is there any way to trigger a sequence of commands in parallel and capture their output in variables? e.g. something on the following lines
x=`echo "X" &`
y=`echo "Y" &`
z=`echo "Z" &`
so that $x, $y, and $z evaluate to X, Y and Z res. (7 Replies)
Hi I want to check if some process is sleeping. I can see that in truss -p <pid>
I want to capture output and check that output if proces sis sleeping. Please suggest way to capture output of truss command or other way to check if process is sleeping (1 Reply)
I want to search files (basically .cc files) in /xx folder and subfolders.
Those files (*.cc files) must contain #include "header.h" AND x() function.
I am writing it another way to make it clear,
I wanna list of *.cc files that have 'header.h' & 'x()'. They must have two strings, header.h... (2 Replies)
&& echo "PLEASE enter the command to capture output" || echo "Processing your command manual"
x=$#
echo $x
while
do
while man $@ | read -r line
do
>$@.txt
... (1 Reply)
Hi,
When I execute this command
prtdiag -v
output sample :
System clock frequency: 160 MHZ
Memory size: 4GB
==================================== CPUs ====================================
E$ CPU CPU
CPU Freq Size ... (4 Replies)
I'm trying to parse COBOL code to combine variables into one string. I have two variable names that get literals moved into them and I'd like to use sed, awk, or similar to find these lines and combine the variables into the final component. These variable names are always VAR1 and VAR2. For... (8 Replies)
Hi there!
I'm trying to write a script that will capture output from a command and assign it to a variable.
Let's say, for example, I'd like to catch from inside the script whatever the following command outputs:
ls *.aaa
and put it into a variable "listoffiles".
What I tried was:
set... (3 Replies)