Mysql erratic output

 
Thread Tools Search this Thread
Special Forums UNIX and Linux Applications Mysql erratic output
# 1  
Old 08-26-2013
Mysql erratic output

Hi,this doesnt give any output
Code:
mysql -uroot -phruti2 -B -e "use WebNmsDB;select HEADERINDEX from meas_headers where CLLI= '$clli' and IVALSTART>'$ivalstart' and IVALSTART<'$ivalend' and RPTTYPE='$rpttype';" > asdf.txt

This generates "good" output
Code:
mysql -uroot -phruti2 -B -e "use WebNmsDB;select HEADERINDEX from meas_headers where CLLI='tklc9010801' and IVALSTART>='01:30:00' and IVALSTART<'02:00:00' and RPTTYPE='COMPONENT MEASUREMENTS ON LINK';" > win.txt

Why so ???

the outputs of
Code:
echo $ivalstart
echo $ivalend
echo $clli
echo $rpttype

respectively are
Code:
01:30:00
02:00:00
tklc9010801
COMPONENT MEASUREMENTS ON LINK


Last edited by Franklin52; 08-26-2013 at 04:05 AM.. Reason: Please use code tags
# 2  
Old 08-26-2013
PLease run your command with the shell's xtrace option set and post the output.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Mysql output to file

Hi, Below is my code to execute mysql statement , how to save the output to a file ? #!/usr/bin/bash #Script to run automated sql queries #Declaring mysql DB connection MASTER_DB_USER='root' MASTER_DB_PASSWD='root' MASTER_DB_PORT=3306 MASTER_DB_HOST='localhost'... (1 Reply)
Discussion started by: Pratik4891
1 Replies

2. Shell Programming and Scripting

Erratic output

Hi I have written a shell script to execute my data base query mysql -uroot -pshruti2 -B -e "use WebNmsDB;select HEADERINDEX from tekelec_meas_headers where CLLI=$clli and \ IVALSTART>="$ivalstart" and IVALSTART<"$ivalend" and RPTTYPE="$rpttype";" > win.txt But the output in win.txt is ... (1 Reply)
Discussion started by: leghorn
1 Replies

3. UNIX and Linux Applications

Please help: Oracle gqsql or sqlplus output format like mysql

On psql select titolo,lingua from titolo where titolo ~* 'brivid'; titolo | lingua ------- + ------ Brivido | 1 On Sqlplus/gqsql SQL> select titolo,genere,anno,lingua from titolo where titolo like '%rivid%'; TITOLO... (6 Replies)
Discussion started by: Linusolaradm1
6 Replies

4. Red Hat

Slow/Erratic wireless internet

Hi everyone, this is my first post on this forum. I have a ASUS laptop dualbooted with win7 and f16(Fedora 16). I recently shifted from Ubuntu. Wireless internet is very slow and rather erratic on my laptop only in the case of Linux. On win7 its flawless. I have a 30mbps connection and I... (0 Replies)
Discussion started by: parth.s
0 Replies

5. Shell Programming and Scripting

Need help getting my output from MYSQL query into right format

Good afternoon! I have been lurking in this forum for awhile now. I have just recently started posting. I think this is a really good site. With that being said, I don't like to just run and get an answer before I try my best first. I have poured some blood, sweat and tears into... (4 Replies)
Discussion started by: brianjb
4 Replies

6. UNIX and Linux Applications

missing delimiters when mysql output is redirected to log file

Hi, Pls check that '|' and '+' present in Step-1 are not copied to log file in Step-3. Pls suggest how to get the exact output from Step-1 (i.e. with out losing '|' and '+') in to a log file ~Thanks Step-1: Execute command > mysql -utest -ptest -htesthost testdb -e "select * from... (3 Replies)
Discussion started by: newbielgn
3 Replies

7. Shell Programming and Scripting

Extract Mysql table output to a log file

I need to compare the 2 mysql database tables. there are around 50 tables in each DB. my idea is in DB1 extract result select * from table1; to alog file1 in DB2 extract result select * from table1; to alog file2 now compare log file 1 file 2 pls help me out ... thanks in advance (5 Replies)
Discussion started by: kalyankalyan
5 Replies

8. Shell Programming and Scripting

How to get df output into MySQL using bash?

Hi All, I want to run some commands and get the output into a mysql database. I want to run the df cmd into a text file, then import it into my db sysinfo using a bash script. My table "df" has the following 9 fields: server, filesystem, size, used, available, useperc, mounted, date, time... (3 Replies)
Discussion started by: pobman
3 Replies

9. Shell Programming and Scripting

Help needed to format mysql output

Hi all, Does anyone know how to format the output from mysql from within a shell script? i.e. RESULT=`mysql command` echo ${RESULT} the ${RESULT} only displays the output on one line instead of how mysql would display it as columns etc (3 Replies)
Discussion started by: muay_tb
3 Replies

10. IP Networking

Erratic ping time issues

Hello, I administer a bunch of Apple XServes running OS X Server and I have one in particular that is annoying me since I brought it online. The host is a dual quad core Intel CPU. en0 is attached to a routable network and en1 is attached to a non-routable network (private switch that all the... (0 Replies)
Discussion started by: gnat
0 Replies
Login or Register to Ask a Question