Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8679601
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T21:00:51+00:00 2026-06-12T21:00:51+00:00

This is my script for generating graphs and combining them. The problem is when

  • 0

This is my script for generating graphs and combining them.
The problem is when i give the inputs and run the file in terminal,it is showing null in the dump file.I think its not executing the mysql command also. Mysql command is working fine if i give the inputs datetime1,datetime2 and moteid in the command itself.I couldnt find where i am going wrong in the mysql query

datetime1=$1

datetime2=$2
moteid=$3

echo " \\documentclass[a4paper,12pt]{article} \

\\usepackage{graphicx} \

\\usepackage{subfigure} \

\\begin{document} \

\\begin{center} \

\\begin{Large} \

\\textbf{ A Network Management System} \\\ \

\\end{Large} \

\\end{center} \

\\vspace{5mm} \

{\bf Report }" > report.tex

flag=0
count_null=0


echo "\\begin{center} \

      {\bf Report generated } \

      \\end{center} " >> report.tex




mysql -u root -e "SELECT (b.l2framessent - a.l2framessent) AS netl2framessent,(b.Frames_Drop-a.Frames_Drop) AS netframesdrop,(b.ETX - a.ETX) AS netetx,CONVERT(endOfInterval*500, DATETIME) endOfInterval FROM (SELECT datetime DIV 500 startOfInterval,l2framessent,Frames_Drop,ETX FROM Statistics3,(SELECT MIN(datetime) mindate FROM Statistics3 WHERE ipaddress=\"$moteid\" AND datetime BETWEEN \"$datetime1\" AND \"$datetime2\" GROUP BY datetime DIV 500) b WHERE ipaddress=\"$moteid\" AND datetime = mindate) a, (SELECT datetime DIV 500 endOfInterval, l2framessent,Frames_Drop,ETX FROM Statistics3, (SELECT MIN(datetime) mindate FROM Statistics3 WHERE ipaddress = \"$moteid\" AND datetime BETWEEN \"$datetime1\" AND \"$datetime2\" GROUP BY datetime DIV 500) b WHERE ipaddress = \"$moteid\" AND datetime = mindate) b WHERE endOfInterval = startOfInterval+ 1 ;" >> dump

sed '1d' dump



##### ETX ######

echo "reset \

set terminal png \

set xdata time \

set timefmt \"%H:%M:%S\" \

set xlabel \"Time\" \

set ylabel \"netetx\" \

set title \"ETX\" \

set grid \

plot \"dump\" using 4:3 title \"ETX\" " >> etx.sh

gnuplot etx.sh > etx.png


#L2 Frames Sent

echo "reset \

set terminal png \

set xdata time \

set timefmt \"%H:%M:%S\" \

set xlabel \"Time\" \

set ylabel \"netL2Framessent\" \

set title \"L2 Frames Sent\" \

set grid \

plot \"dump\" using 4:1 title \"L2 Frames Sent\" " >> frames.sh

gnuplot frames.sh > frames.png


#Frames Drop

echo "reset \

set terminal png \

set xdata time \

set timefmt \"%H:%M:%S\" \

set xlabel \"Time\" \

set ylabel \"netframesdrop\" \

set title \"L2 Frames Drop\" \

set grid \

plot \"dump\" using 4:2 title \"L2 Frames Drop\" " >> framesdrop.sh

gnuplot framesdrop.sh > framesdrop.png


##   TEX  FILE  GENERATION ####


echo "\\begin{figure}[h] \

\\begin{center} \

\\subfigure[ETX]{\label{fig:edge-1a}\includegraphics[width=2.6in,height=2.5in]{etx.png}} \

\\hspace{1mm} \

\\subfigure[L2 Frames Sent]{\label{fig:edge-1b}\includegraphics[width=2.6in,height=2.5in]{frames.png}} \



\\end{center} \

\\label{fig:edge} \

\\end{figure} \

\\begin{figure}[h] \

\\begin{center} " >> report.tex



echo "\\subfigure[L2 Frames Drop]{\label{fig:edge-2a}\includegraphics[width=2.5in,height=2.5in]{framesdrop.png}} \

\\hspace{3mm}  >> report.tex



\\end{center} \

\\label{fig:edge} \

\\end{figure} \

\\clearpage " >> report.tex




echo "\\end{document} " >> report.tex

pdflatex report.tex > /dev/null

In the terminal to run the output i gave,
sh plot.sh “2012-09-25 15:45:00” “2012-09-29 18:45:00” “5”
and the output is

plot "dump" using 4:3 title "ETX" 
                            ^
"etx.sh", line 12: warning: Skipping data file with no valid points

plot "dump" using 4:3 title "ETX" 
                                  ^
"etx.sh", line 12: x range is invalid


plot "dump" using 4:1 title "L2 Frames Sent" 
                            ^
"frames.sh", line 12: warning: Skipping data file with no valid points

plot "dump" using 4:1 title "L2 Frames Sent" 
                                             ^
"frames.sh", line 12: x range is invalid


plot "dump" using 4:2 title "L2 Frames Drop" 
                            ^
"drop.sh", line 12: warning: Skipping data file with no valid points

plot "dump" using 4:2 title "L2 Frames Drop" 
                                             ^
"drop.sh", line 12: x range is invalid



RUN SUCCESSFUL (total time: 154ms)

If i give this mysql query instead of that,its working fine

mysql -u root -e "SELECT (b.l2framessent - a.l2framessent) AS netl2framessent,(b.Frames_Drop-a.Frames_Drop) AS netframesdrop,(b.ETX - a.ETX) AS netetx,CONVERT(endOfInterval*500, DATETIME) endOfInterval FROM (SELECT datetime DIV 500 startOfInterval,l2framessent,Frames_Drop,ETX FROM Statistics3,(SELECT MIN(datetime) mindate FROM Statistics3 WHERE ipaddress='moteid5' AND datetime BETWEEN '2012-09-25 15:45:00' AND '2012-09-25 18:45:00' GROUP BY datetime DIV 500) b WHERE ipaddress='moteid5' AND datetime = mindate) a, (SELECT datetime DIV 500 endOfInterval, l2framessent,Frames_Drop,ETX FROM Statistics3, (SELECT MIN(datetime) mindate FROM Statistics3 WHERE ipaddress = 'moteid5' AND datetime BETWEEN '2012-09-25 15:45:00' AND '2012-09-25 18:45:00' GROUP BY datetime DIV 500) b WHERE ipaddress = 'moteid5'AND datetime = mindate) b WHERE endOfInterval = startOfInterval+ 1 ;" >> dump
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T21:00:53+00:00Added an answer on June 12, 2026 at 9:00 pm

    The command:

    sed '1d'
    

    isn’t given an input file, so it’s reading from standard input. So it’s waiting for you to type something. I suspect you meant to pipe the output of mysql to it, so it should be:

    mysql -u root -e "SELECT ..." | sed 1d >> filename
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am generating new xml file using perl script but I have small problem,
I'm generating auto incremental code through a PHP script. The sequence goes like this,
For this script, it checks to see if the file is a microsoft words
I have this script that run to fix my menu bar to the browser
I'm generating a script like this (echo ssh hans@mymachine.com echo hello ; echo 'echo
I'm generating matplotlib figures in a script which I run alternatively with or without
This script saves the files as /home/name/main/all my files and stuff . I want
This script cannot find bannersize unless I write <div id=bannersize></div> before the javascript. The
This script works fine on single click but on double click it shows both
This script successfully generated the pdfs to a folder tmp/.... However the ZIP output

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.