Sponsored Content
Full Discussion: sed scripting help need
Top Forums Shell Programming and Scripting sed scripting help need Post 302332887 by raghur77 on Friday 10th of July 2009 10:17:12 AM
Old 07-10-2009
Hi Panyam,

its working now...thanks a lot!!!

---------- Post updated at 09:17 AM ---------- Previous update was at 08:25 AM ----------

hi scottn,

I tried u r code...
sar ... | awk '(NR > 1) && ($NF < 30) {$0 = "HI " $0 " BYE"} { print}'

the output is....

sar | awk '(NR > 1) && ($NF < 30) {$0 = "HI " $0 " BYE"} { print}'
Linux 2.6.9-78.ELsmp (lrtp68) 07/10/2009
HI BYEHI 12:00:01 AM CPU %user %nice %system %iowait %idle BYE
12:05:01 AM all 2.32 0.00 0.41 0.00 97.27
12:10:01 AM all 1.86 0.00 0.27 0.00 97.87
12:15:01 AM all 5.10 0.00 1.00 0.17 93.73
12:20:01 AM all 2.47 0.00 0.25 0.00 97.28
12:25:01 AM all 2.13 0.00 0.24 0.00 97.63
12:30:01 AM all 2.32 0.00 0.39 0.01 97.28
12:35:01 AM all 6.58 0.00 0.62 1.19 91.61
12:40:01 AM all 2.25 0.00 0.26 0.00 97.49
12:45:01 AM all 2.42 0.00 0.27 0.00 97.31
12:50:01 AM all 2.14 0.00 0.27 0.00 97.59
12:55:01 AM all 2.56 0.00 0.59 0.01 96.85
01:00:01 AM all 1.97 0.00 0.23 0.01 97.78
10:00:01 AM all 4.31 0.00 0.75 0.01 94.94
10:05:01 AM all 3.26 0.00 0.78 0.01 95.96
Average: all 3.36 0.00 0.50 0.02 96.11
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

scripting help with touch and sed

Hello, I am trying to write a simple script to wake up every 300 seconds and look for a new file in a directory (e.g., "G102005"), remove the "G" from the file name, then print the new filename. Here's what I've got so far. I'm new at this so please forgive the errors or misuse of syntax. It... (14 Replies)
Discussion started by: alexkav
14 Replies

2. Shell Programming and Scripting

scripting with awk and sed

hey all, i was just wondering if it was possible to to get data from user input , and parse it through sed to remove or add what that user has entered into a flat file? do i need awk ? any help is greatly appreciated ~shan2on (2 Replies)
Discussion started by: shan2on
2 Replies

3. Shell Programming and Scripting

SED scripting select

Say I have a file 'example.txt' with these lines of code in it: hello:anddasd:cheese:gerg whatever:sdadsa:asdfasdfa:wwew hmmmm:something:gfhfhgf:sdasdas Question: 1. How would I write a script which is able to take all the words before the first ':'? 2. How would I write a script which is... (6 Replies)
Discussion started by: i_am_a_robot
6 Replies

4. Shell Programming and Scripting

sed or awk scripting help needed

hi all, for an example : df -k output shows: $ df -k Filesystem 1K-blocks Used Available Use% Mounted on /dev/cciss/c0d0p6 3099260 1117760 1824068 8% / /dev/cciss/c0d0p1 256666 18065 225349 8% /boot none 8219180 0 8219180 0% /dev/shm /dev/mapper/vglocal-home 1032088 245172 734488 26%... (7 Replies)
Discussion started by: raghur77
7 Replies

5. Shell Programming and Scripting

Shell Scripting -- sed

Hi, In one of my scripts, I am using sed to do an expression replacement. The code in the script is as under sed "s|MY_INP_Lab=""|MY_INP_Lab="${2}"|" file1, where $2=xyz_abc_mbk The EXPECTED output is in file1, all the instances ofMY_INP_Lab="" shall be replaced by... (2 Replies)
Discussion started by: vivekmattar
2 Replies

6. Shell Programming and Scripting

Sed scripting issue

Hi all! I was wondering if anyone could help suggest some solutions to an issue i'm having using the Sed command. I'm still a relative novice at this, but slowly learning and enjoying the power of batch processing. I am using Sed to extract values from a .txt file containing hundreds of... (2 Replies)
Discussion started by: StudentFitz
2 Replies

7. Shell Programming and Scripting

Need help with sed scripting

Hi expert, i need URGENT help in bash shell scripting using sed: i woud like to search for the word XMLRPC which is at theend of the line below in up2date file. Once found or match serverURL=https://redhat.com/XMLRPC replace with myserver.com like this ... (1 Reply)
Discussion started by: lamoul
1 Replies

8. Shell Programming and Scripting

sed newbie scripting assistance

Howdy folks, I'm trying to craft a log file summarisation tool for an application that creates a lot of duplicate entries with only a different suffix to indicate point of execution. I thought I'd gotten close but I'm clearly missing something. Here's a genericized version: A text_file... (3 Replies)
Discussion started by: mthespian
3 Replies

9. Shell Programming and Scripting

Need help with awk and sed scripting

I need help with sed and awk scripts to search for Symmetrix ID=000090009902 and then grep its child disk devices associated to the dead paths and display them only, so that those dead devices can be removed. test01:/#powermt display dev=all Pseudo name=hdiskpower0 Symmetrix ID=000090009902... (4 Replies)
Discussion started by: aix_admin_007
4 Replies

10. Shell Programming and Scripting

Help shell scripting using awk or sed or other

I need to create a script to change a file depending of 3 conditions using a target as parameter... first condition <chamada> <numeroTerminalOriginador>CALLER</numeroTerminalOriginador> <imeiOriginador></imeiOriginador> <cgiPrimeiraErbOriginador></cgiPrimeiraErbOriginador>... (2 Replies)
Discussion started by: poulis
2 Replies
Rscript(1)								FSF								Rscript(1)

NAME
Rscript - front end for scripting with R SYNOPSIS
Rscript [--options] [-e expr] file [args] DESCRIPTION
A binary front-end to R, for use in scripting applications. expr An optional expression to be evaluated, used in place of expr. file Input file of R expressions args Optional further arguments to be processed by commandArgs in the R interpreter. OPTIONS
--options accepted are --help Print usage and exit --version Print version and exit --verbose Print information on progress --default-packages=list Where 'list' is a comma-separated set of package names, or 'NULL' and also options to R (in addition to --slave --no-restore), such as --save Do save workspace at the end of the session --no-environ Don't read the site and user environment files --no-site-file Don't read the site-wide Rprofile --no-init-file Don't read the user R profile --restore Do restore previously saved objects at startup --vanilla Combine --no-save, --no-restore, --no-site-file --no-init-file and --no-environ SEE ALSO
R(1) R scripting April 2007 Rscript(1)
All times are GMT -4. The time now is 10:04 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy