Sponsored Content
Top Forums UNIX for Dummies Questions & Answers multiple graphs on same window Post 302440935 by rdcwayx on Thursday 29th of July 2010 02:41:48 AM
Old 07-29-2010
Your code is little long, and can be simplified. First from the "grep-tail-awk"

Code:
grep "DIXIN1O" /root/msc/scripts/files/traffic_$today.log | tail -1 | awk -F" " '{print $1","$3","$2}' > /root/msc/scripts/fi
les/SUM_DX.log
#grep "DIXIN1I" /root/msc/scripts/files/traffic_$today.log | tail -1 | awk -F" " '{print $1","$3","$2}' >> /root/msc/scripts/
files/SUM_DX.log
grep "DIXIN2O" /root/msc/scripts/files/traffic_$today.log | tail -1 | awk -F" " '{print $1","$3","$2}' >> /root/msc/scripts/f
iles/SUM_DX.log
#grep "DIXIN2I" /root/msc/scripts/files/traffic_$today.log | tail -1 | awk -F" " '{print $1","$3","$2}' >> /root/msc/scripts/
files/SUM_DX.log

Can be replaced by one awk

Code:
awk 'BEGIN{OFS=","} 
     /DIXIN1O/ {a[1]=$1;a[2]=$2;a[3]=$3]}
     /DIXIN2O/ {b[1]=$1;b[2]=$2;b[3]=$3]}
     END {print a[1],a[3],a[2]
          print b[1],b[3],b[2]} /root/msc/scripts/files/traffic_$today.log > /root/msc/scripts/files/SUM_DX.log



---------- Post updated at 04:41 PM ---------- Previous update was at 04:31 PM ----------

Code:
sed -n '/^DATE/ {n; p;}' /root/msc/scripts/files/traffic_$today.log | awk -F" " '{print $1,$2}' > /root/msc/scripts/files/date_time.txt

can be changed to :

Code:
awk '/^DATE/ {next;print $1,$2}' /root/msc/scripts/files/traffic_$today.log >/root/msc/scripts/files/date_time.txt

 

9 More Discussions You Might Find Interesting

1. Windows & DOS: Issues & Discussions

window 2000 professional not pinging my window 98 system.

Hello, We someone help me resolve this problem. I have window 2000 professional, windows 98 and Unixware 7.0.1 on the network. I was able to establish connection with all. However, l was unable to ping window 98 from window 2000 professional. I was able to ping the window 2000 from the window... (10 Replies)
Discussion started by: kayode
10 Replies

2. Solaris

Multiple Hosts on Solaris CDE window

I forgot how to configure multiple host servers on the my CDE windows in Solaris. I'll appreciate any help Thanks, Remi (2 Replies)
Discussion started by: Remi
2 Replies

3. Shell Programming and Scripting

Creating graphs

Platform: solaris 9 x86 I want to be able to create excel like line graphs with basic input data and use it on a webpage or worst case so I can use it to insert to a document type of input file I would have, example below datainput.txt: date,requests,failures,success 20100501,80,10,70... (5 Replies)
Discussion started by: frustrated1
5 Replies

4. Ubuntu

run multiple command at the same time in one window terminal using multiplexer

Hi, I would like to ask if someone knows or accomplished this task in the terminal multiplexer in a single window with multiple splitted pane: In the script run multiple command at the same time in diff splitted pane or simulatneously. As an example: I would like to run iptraf, iotop, htop,... (2 Replies)
Discussion started by: jao_madn
2 Replies

5. Shell Programming and Scripting

How to create multiple input box in same window using dialog

Hi All, I was trying to generate GUI using shell script. After long search I found the utility called “dialog”. Using this utility I am able to generate window to collect the input. dialog --inputbox "Input 1" 10 45 dialog --inputbox "Input 2" 10 45 dialog --inputbox "Input 3" 10 45 Using... (2 Replies)
Discussion started by: kalpeer
2 Replies

6. Programming

Help with Graphs (BFS mostly)

Okay so I posted a thread about my project before, how I need to create generated word ladders and all that. Now I am to the point where I need to create a method which will find the shortests path between a start word and an end word. For example: startWord: Head endWord: Feet And then a... (3 Replies)
Discussion started by: SilvarHawke
3 Replies

7. Shell Programming and Scripting

Script to launch a KDE Konsole window with multiple tabs

Gents, I found this script to to launch a KDE Konsole window with multiple tabs.. #!/bin/bash # # Create my standard konsole windows. if ]; then profile=Shell fi sessions=( sh1 $profile 'clear; bash' sh1 $profile 'clear; bash' su1 $profile 'clear; su'... (1 Reply)
Discussion started by: jiam912
1 Replies

8. Red Hat

Do not show graphs cacti

hi installed caci and Snmp connection is established 10.10 (192.168.10.10) SNMP Information System:Hardware: Intel64 Family 6 Model 23 Stepping 6 AT/AT COMPATIBLE - Software: Windows Version 6.1 (Build 7601 Multiprocessor Free) Uptime: 7550665 (0 days,... (2 Replies)
Discussion started by: mnnn
2 Replies

9. UNIX for Beginners Questions & Answers

Toggle between xterm window and standard terminal window

Is it possible to toggle back and forth between an xterm invoked from one tty, and a shell invoked from a different tty? I am running Centos 7 with KDE and booting in non-graphic mode. After logging in on the default window (/dev/tty1) , I can then use ALT-F2 to access a new window (/dev/tty2),... (1 Reply)
Discussion started by: rhgscty
1 Replies
ZGREP(1)						      General Commands Manual							  ZGREP(1)

NAME
zgrep - search possibly compressed files for a regular expression SYNOPSIS
zgrep [ grep_options ] [ -e ] pattern filename... DESCRIPTION
Zgrep invokes grep on compressed or gzipped files. These grep options will cause zgrep to terminate with an error code: (-[drRzZ]|--di*|--exc*|--inc*|--rec*|--nu*). All other options specified are passed directly to grep. If no file is specified, then the standard input is decompressed if necessary and fed to grep. Otherwise the given files are uncompressed if necessary and fed to grep. If the GREP environment variable is set, zgrep uses it as the grep program to be invoked. EXIT CODE
2 - An option that is not supported was specified. AUTHOR
Charles Levert (charles@comm.polymtl.ca) SEE ALSO
grep(1), gzexe(1), gzip(1), zdiff(1), zforce(1), zmore(1), znew(1) ZGREP(1)
All times are GMT -4. The time now is 07:09 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy