How to get the input using variable?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to get the input using variable?
# 1  
Old 07-04-2016
How to get the input using variable?

Hi all,

Using shell script i need to send this report to the user. The department number will be mentioned every time in the input file as an input. I am not sure how to write a script by taking the department number from the text file.

Code:
select * from account where department in (101,102,103)

Any help would be greatly appreciated.
# 2  
Old 07-04-2016
Seems you have been banned at least once before.

In reference to Scott's last post here:
Shell script question in special character

Thread is closed.
This User Gave Thanks to zaxxon For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Passing variable as input & storing output in other variable

I have a below syntax its working fine... var12=$(ps -ef | grep apache | awk '{print $2,$4}') Im getting expected output as below: printf "%b\n" "${VAR12}" dell 123 dell 456 dell 457 Now I wrote a while loop.. the output of VAR12 should be passed as input parameters to while loop and results... (5 Replies)
Discussion started by: sam@sam
5 Replies

2. Shell Programming and Scripting

XML variable for input in same input file

Dear All , i stuck in one problem executing xml .. i have input xml as <COMMAND name="ARRANGEMENT.WRITE" timestamp="0" so="initial"> <SVLOBJECT> <LONG name="CSP_PMNT_ID" val="-1"/> <MONEY name="CSP_CEILING" amount="0.0" currency="AUD"/> ... (6 Replies)
Discussion started by: arvindng
6 Replies

3. UNIX for Dummies Questions & Answers

Getting input and changing variable?

Hi I am new to scripting and have a function in my .sh script file that outputs a html radio button form weather_forecast_config() { echo "" echo "<html><head><title>Welcome</title></head>" echo "<body>" echo "<h2>Weather Forecast - Change City</h2>" echo "<form name="input"... (5 Replies)
Discussion started by: scriptnewbie
5 Replies

4. Solaris

how i can input string from variable

hello every body my system is solaris 8 and my problem is i have a lot of user to change password so i'm key password every user and i want to input password from variable my script grep xxx shadow |while read a do passwd $a done #new password... (2 Replies)
Discussion started by: infjustice
2 Replies

5. Shell Programming and Scripting

Shell variable to c++ program as input

I have an Shell script which has few global variables eg : range=100; echo "$range" I want to use the same variable in my C++ program for example int main() { cout << range << "\n"; } i tried using this int main(int argc, char *argv) { cout << range << "\n"; } but... (5 Replies)
Discussion started by: shashi792
5 Replies

6. Programming

How to check an input variable

Suppose we have a simple situation, like the following C++ instructions: int x; cout << "Insert x: "; cin >> x; while ( x-- < 0 ) ; Of course, if it is written something different from an integer, the while loop shall not end. So, how can we check if the input x is of the right type? (2 Replies)
Discussion started by: Luke Bonham
2 Replies

7. UNIX for Dummies Questions & Answers

Input A Menu Selection In A Variable

hey all, me again....having a problem with my code, where I essentially am trying to show a menu, have the user select an option (from 1 to 5), then display which selection they picked... #!/bin/bash # A LIST OF THE ERROR MESSAGES AND THE PROPER SYNTAX: error_0="Correct amount of... (1 Reply)
Discussion started by: SoVi3t
1 Replies

8. UNIX for Advanced & Expert Users

Using Variable As Input For mailx

All, I'm having difficulty using a variable as the body of an e-mail; I suspect it has to do w/quoting, but am not sure. Right now I have separate functions for sending information and for sending errors. I'd like to set a variable (BODY) to use as input to mailx so I can have a generic function... (3 Replies)
Discussion started by: GregWold
3 Replies

9. Shell Programming and Scripting

How to get variable input from a file

Hi guys, I want to input some variables from a file. I tried it with following script, for i in 1 2 3 4 do read varible1 varible2 < ddd.txt echo $varible1 $varible2 done ... (1 Reply)
Discussion started by: maheshsri
1 Replies

10. Shell Programming and Scripting

please help: how to redirect input into a variable

I'm trying to write a simple script program (C shell). I have a problem redirecting input into a variable. Say I have a variable called J, and there is file called result which contains just some number, say 5. Which command should I use to assign J value 5 from the file result. I tried the... (2 Replies)
Discussion started by: artur80
2 Replies
Login or Register to Ask a Question