I wanna to read the output of various commands like mpstat, vmstat, etc... but want to output this to a file with each line preceeded by a time stamp.
I've played around with various loops, shell redirection, custom descriptors and etc.. but can't seem to get something to work. I did this years ago and know it can be done but my scripting skills have gotten way rusty.
Anyone have any tricks for doing something like this?
Would you like unix time, gregorian date-time, microseconds, delta microseconds? Simplest with min latency:
Commands that read stdin with a buffered FILE* often get the pipe data several K at a time, delayed. I have found that reading one byte at a time, like line does, overcomes this latency. Commands that write() one line at a time may not have this problem. Your UNIX may vary!
Hello, I have a file in the following format
id sample platform R1 R2 gene1 gene2 gene3
1 abc llumina R1_001.fastq.gz R2_001.fastq.gz apoe prnpp asp
2 def llumina R1_001.fastq.gz R2_001.fastq.gz apoe prnpp
3 ghi llumina ... (3 Replies)
The problem I am having now is calling and reading a command and The Main script reads the data file and passes the input to the two calculation scripts, and than output to a file.
1.
The Main Script
-----------------
input=inputfilepj3
output=outfilepj3
echo "*** Converting... (2 Replies)
I getting error as test1.sh: syntax error at line 3: `do' unexpected while i was trying to run below code..
What was going wrong here?
find /usr/tmp/SB/reports/ -type f -name *.rdf |read file;do
echo "Copying $file to /usr/tmp/SB1"
done (1 Reply)
set -A title
set -A author
count=1
index=0
while
do
read -A ${title}?"Booktitle: "
read -A ${author}?"Author(s): "
(( count = count + 1 ))
(( index = index + 1 ))
done
Hi... (1 Reply)
Hi,
Just some questions on the script below...?
Given: bash-2.03$ command -a option1 name1 name2
ParseOptions()
{
local Len=${#@}
local Ctr=2 #always start at 2
local Name=()
local Iter=0
while ; do
if <- Is this correct? so I can get the $2... (2 Replies)
Dear All,
I want to get the rows from file1.txt whose first column is exactly as the numbers (not subset) from file1.txt. so, i have to read by line from file1.txt and search in file2.txt. So the first column of the output must be the same as the file1.txt.
I used
% egrep -w -f... (5 Replies)
Hi
I want to give the user the choice of whether or not they want to include a certain option when they run the script.
This is my getops:
while getopts " s: d: r f: e h " option
do
case $option in
f ) dsxfile="$OPTARG";;
d ) dbname="$OPTARG";;
s ) dsn="$OPTARG";;
r )... (0 Replies)
Hello all, I know it can be done but don't know the command.
I would like to run vmstat via cron, I don't know a good interval and don't want huge logs but want stats pretty often.
Please someone who uses vmstat via cron let me know what your script looks like.
Thank you (11 Replies)
Can any body please explain the following df command to me:filesystem kbytes used avail capacity mounted on
/dev/root 6474195 2649052 3825143 41% /
/dev/stand 24097 5757 18340 24% /stand
/proc 0 0 0 ... (7 Replies)