Sponsored Content
Top Forums Shell Programming and Scripting Passing a variable from shell script to mysql query? Post 302324342 by vidyadhar85 on Wednesday 10th of June 2009 01:32:24 PM
Old 06-10-2009
what shell are you using??
Code:
cid=`awk 'NR==2{print $2}' /home/test.txt `
echo "cid is" $cid

rest that cat and piped to dbconnect i didn't understand

and if cid is variable use $cid not &cid
Code:
select * from Notifications join Events using (EventId) where CustomerId = '$cid';

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

passing awk variable to the shell script

hi; i have a file containing lines like: 1|1069108123|96393669788|00963215755711|2|0|941||;serv:Pps6aSyria;first:0;bear i want to extract the second, third and fourth record of each line and store it in a file ";" seperated this is what i wrote while read line do ... (3 Replies)
Discussion started by: bcheaib
3 Replies

2. Shell Programming and Scripting

error in passing a variable to sqlplus from a shell script

hi, I am using a shell script from where i will be conecting to sqlplus.. i am having a problem in passing a variable to sqlplus query.. i will be assigning the variable in the unix environment..whenever i am trying to pass a variable having the contents greater than 2500 characters, i am... (3 Replies)
Discussion started by: kripssmart
3 Replies

3. UNIX for Advanced & Expert Users

Passing Hash variable in to sql query in perl

Hi Everyone, Can anyone help me how do i call hash variable in to sql query in perl. Please see the script below i have defined two Hash %lc and %tab as below $lc{'REFF'}='V_RES_CLASS'; $lc{'CALE'}='V_CAP_CLASS'; $lc{'XRPD'}='V_XFMR_CLASS'; $tab{'V_RES_CLASS'}='V_MFR_SERS';... (6 Replies)
Discussion started by: jam_prasanna
6 Replies

4. Shell Programming and Scripting

Passing variable from shell script to python script

I have a shell script main.sh which inturn call the python script ofdm.py, I want to pass two variables from shell script to python script for its execution. How do i achieve this ????? Eg: main.sh a=3 b=3; c= a+b exec python ofdm.py ofdm.py d=c+a Thanks in Anticipation (4 Replies)
Discussion started by: shashi792
4 Replies

5. Shell Programming and Scripting

Using a shell script variable in a mysql query using 'LIKE'

Hello. I am writing a simple script that reads a text file and removes records from a mysql database. The items in the text file are of the format: firstname.middle.lastXXX, where XXX is a 3 digit number. The table has an email field that will match the firstname.middle.last. So, I thought I... (1 Reply)
Discussion started by: bricoleur
1 Replies

6. Shell Programming and Scripting

Issue with passing variable to Grep in a shell script

Hi, I'm trying to check if methods specified in a class have been added to the corrosponding interface. My code below is giving me the following errors: grep: function: No such file or directory grep: import($zipfile): No such file or directory grep: function: No such file or... (1 Reply)
Discussion started by: racshot65
1 Replies

7. Shell Programming and Scripting

Passing shell variable to awk script

I want to pass a shell variable to awk script : # cat file PSAPSR3 3722000 91989.25 2 98 PSAPSR7 1562000 77000.1875 5 95 PSAPUNDO 92000 4087.5625 4 96 #... (8 Replies)
Discussion started by: Reboot
8 Replies

8. Shell Programming and Scripting

Passing value of variable to a query within shell script

I have a script in which i connect to database to run a query and get the result of the query to a temp file. This works fine , now what i want is there is flat file which contains the value to be used in the query. I want to read this file line by line and then run the query for each value in that... (7 Replies)
Discussion started by: gpk_newbie
7 Replies

9. Shell Programming and Scripting

Shell script automation using cron which query's MySQL Tables

What I have: I have a input.sh (script which basically connect to mysql-db and query's multiple tables to write back the output to output1.out file in a directory) note: I need to pass an integer (unique_id = anything b/w 1- 1000) next to the script everytime I run the script which generates... (3 Replies)
Discussion started by: kkpand
3 Replies

10. UNIX for Beginners Questions & Answers

Variable definition inside mysql query

Hello, I am running ubuntu16.04. By means of @Rudic's help, I have below command. What I need to do is to replace video_id by value of video_id in which WHERE clause is matched: {print "INSERT INTO video_series_files (id, video_id, file_type, protocol, \ url, languages, quality, accessed... (12 Replies)
Discussion started by: baris35
12 Replies
MHEARD(1)						     Linux Programmer's Manual							 MHEARD(1)

NAME
mheard - display AX.25 calls recently heard. SYNOPSIS
mheard [-d cmns] [-n] [-o cfpt] [-v] [port...] DESCRIPTION
Mheard displays information about most recently heard AX.25 callsigns, the interface upon which they were heard, the total packets heard, the time at which the last one was heard and other information. Mheard displays different information, in different orders depending on the settings of the arguments. Information on specific ports can be displayed by giving the port names as arguments. OPTIONS
-d cmns Sets the information that is displayed for each AX.25 callsign heard. The different arguments are: c Display all the information with regard to callsigns, from-callsign, to-callsign, port name, and any digipeaters that may be in use. m Display miscellaneous information, the from-callsign, port name, no frames heard, the last type of frames heard, and which different PIDs have been heard from that station. n Display the default information. This is the from-callsign, port name, no frames heard and the date and time last heard. s Displays statistics about the station heard, the from-callsign, port name, no I frames, no S frames, no U frames, time first heard, and time last heard. -n Supress the displaying of titles. -o cfpt Sets the ordering of the information displayed. The meanings of the different arguments are: c Sort list by from-callsign. f Sort list by number of frames heard. p Sort list by port name. t Sort list by the time last heard, this is the default. -v Display the version. FILES
/var/ax25/mheard/mheard.dat /etc/ax25/axports SEE ALSO
ax25(4), mheardd(8). AUTHOR
Jonathan Naylor G4KLX <g4klx@g4klx.demon.co.uk> Linux 19 August 1996 MHEARD(1)
All times are GMT -4. The time now is 03:00 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy