hi Friends,
I am writing a shell script to extract data from sar logs for my daily analysis.
I have this in sar logs
What i want is something like below:
So what i am trying to do is fill those rows which dont have the timings with the immediate previous one which has, like here the second row.
What challenges i am facing:
1. What logic to implement and how to get the timings in all the rows filled?
Its been a long time since i have written a script .
2. Something i tried was
But the problem with this logic is if the device column has any name starting with any other alphabet other than 'd' then it doesn't work.
Why i am doing all this?
Basically i will convert all the sar data into csv format and put it in a db table and then make graphs using excel ,by connecting to the db , whenever i need to .
Please can you suggest the solutions to my challenges.
Hi All,
I'm trying to print calendar using shell script and i'm able to print it. But the format is not good.
Here is the script.
#!/bin/bash
echo $(date)
echo "Hello $USER"
echo Hostname $(hostname)
echo Working in $(pwd)
echo Here is this month calender
echo $(cal)
$ sh first.sh... (7 Replies)
hi friends,
I am working on extracting data from sar logs for analysis.
What is want to do is insert the date. The way i am doing is incrementing the date if i see the hour gets reduced (i.e. from 23 hours to 00 hours). Somehow the script which i have made is not able to handle the logic w.r.t... (3 Replies)
Hi,
I am writing a script which processes large number of files in a directory. I wanto display a counter which increment after processing each file. I am processing each file in a for loop. If I echo a variable with its value increasing with each file, I will get around 5000 lines as output.... (10 Replies)
Hi,
I want to display both html and plain in email in my script.
i tried the below code
code:
export MAILTO="ssi@a.com"
export CONTENT1="$htmlfile"
export CONTENT2="$plainfile"
export SUBJECT="INFO "
export MAILFROM="si@a.com"
(
echo "Subject: $SUBJECT"
echo "MIME-Version:... (4 Replies)
Hello friends,
I am a script which dispalys a multiple files with their contents.
for exm:
suppose two file test1.txt and test2.txt.
when I run my script it have to display the below O/P.
test1.txt
-rw-r----- 1 sranga staff 91 Sep 23 02:18 calc.sh
-rw-r----- 1 sranga ... (2 Replies)
Hello,
I have to create shell script being myself real novice in scripting...
I was looking on the Internet for some script examples, but I don't have the basic understanding of the shell. I was trying to do something with “ps” command without success.
For exemple total number of... (2 Replies)
Hi,
I am developing a shell script that would install a software when it is run.
I want to displaying Installing <so and so>........ when it is actually installing it.
I want it to be dynamic, in the sense, I want the dots after installing grow and drop.
Is there a way we can do it.... (1 Reply)
I remember learning that there is a way to make a shell script display the script itself to standard output while the script is being executed but I can't find how to do that. Any pointers? (2 Replies)