Sponsored Content
Top Forums Shell Programming and Scripting Passing parameter from one file to shell script Post 302252298 by Amit.Sagpariya on Wednesday 29th of October 2008 07:50:05 AM
Old 10-29-2008
Hi Joeyg,

I found the answer.

file1
====
COUNTRYCODE,LD_DATE
AB,20081210

file2.sh
======
#!/bin/sh
var1=`sed '1d' File1 | cut -d, -f1`
var2=`sed '1d' File1 | cut -d, -f1`

echo $var1
echo $var2
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

passing parameter from Shell-script to Sql-script

Dear Friends, Please help me to achieve the following: I want to pass one parameter from Shell-script to Sql-script. Example: My ShellScript.sh is calling report.sql like this: /bin/sqlplus /reports.sql And My report.sql is calling many Stored-Procedures like this: exec... (0 Replies)
Discussion started by: subodhbansal
0 Replies

2. Shell Programming and Scripting

passing parameter 4m shell script to a DB stored procedure

hi all please tell me how to pass parameters 4m shell script to a DataBase stored procedure. To be specific i have sybase DB. i mean i want the syntax of the command.. how to connect to DB, pass user id and password, pass the required parameter to SP.. .. need ur help frnds.. hema (0 Replies)
Discussion started by: hema2026
0 Replies

3. AIX

Passing a parameter to a shell script?

I would like to run a compress script on files in certain directories. My compress_script.sh is just basically compress file* In order for me to use this I have to copy it into each directory and run it. How can I state the directory on the command line with the compress script so it... (2 Replies)
Discussion started by: NycUnxer
2 Replies

4. SCO

Parameter passing to dot shell script

OS SCO Open Server 6.0 MP4 I am trying to change the value of a enviornment variable thru a script and want to pass a parameter on the commande line, If I hard code the value inside the script the script changes the enviornment variable . mytest where my test is MYVAR=$1 export MYVAR... (6 Replies)
Discussion started by: atish0
6 Replies

5. Shell Programming and Scripting

Passing Parameter containing space in between to Shell Script

Hi, I have one shell script which use two parameter however one of its parameter have space in between. eg. a.sh 20110114 b c d here b c d is one parameter I used 'b c d' but its not giving correct result. Also i tried b\c\d but this one also didnt work. Any help would be... (5 Replies)
Discussion started by: diehard
5 Replies

6. Shell Programming and Scripting

Passing string as a input parameter for a shell script

Hi i have a shell script which needs a string as an input parameter. How to pass the string param as an input? In command line am running the script. for e.g., a="who is a buddy?" sh sample.sh $a Inside the script i get this input param as $1 but only the value "who" is accepted... (12 Replies)
Discussion started by: vidhyaS
12 Replies

7. Shell Programming and Scripting

Passing parameter to script, and split the parameter

i am passing input parameter 'one_two' to the script , the script output should display the result as below one_1two one_2two one_3two if then echo " Usage : <$0> <DATABASE> " exit 0 else for DB in 1 2 3 do DBname=`$DATABASE | awk -F "_" '{print $1_${DB}_$2}` done fi (5 Replies)
Discussion started by: only4satish
5 Replies

8. Shell Programming and Scripting

Passing a parameter from a shell script to sqlplus

Hi All, I'm new to Linux and scripting, apologies in advance for 'stupid' questions. Please help... Im writing a script that calls a sqlplus script but the sqlplus requires inputs and i cant seem to get this to work. here is my code. #!/bin/sh TERM=vt100 export TERM... (4 Replies)
Discussion started by: Mahomed
4 Replies

9. UNIX for Dummies Questions & Answers

Passing shell script parameter value to awk command in side the script

I have a shell script (.sh) and I want to pass a parameter value to the awk command but I am getting exception, please assist. diff=$1$2.diff id=$2 new=new_$diff echo "My id is $1" echo "I want to sync for user account $id" ##awk command I am using is as below cat $diff |... (1 Reply)
Discussion started by: Sarita Behera
1 Replies

10. Shell Programming and Scripting

Passing parameter with single quote to shell script

Hello All, I am trying below +++++++++ #/bin/bash set -x Host=$1 Port=$2 User=$3 Pass=$4 Warning=$5 Critical=$6 SCRIPT_LOC=/opt/agent/ Parameters="'""hostname=$Host&""port=$Port&""username=$User&""password=$Pass&""jvm=UsedMemory,$Warning,$Critical""'" echo $Parameters... (10 Replies)
Discussion started by: sundari127
10 Replies
geoip(3)							    Version 0.2 							  geoip(3)

NAME
geoip - A Tcl extension for geographic or organisational lookup of IP addresses and hostnames. SYNOPSIS
geoip open [-type TYPE ] [-flags FLAG ] geoip open [-file PATH ] [-flags FLAG ] geoip [COMMAND] geoip [QUERY] arg1 DESCRIPTION
This Tcl extension encapsulates most of GeoIP C API functions into tcl commands. OPEN OPTIONS
open takes either a file path and a set of flags, or a type and a set of flags. Supported types and flags are described below. TYPE Looks under the standard installation share directory, eg /usr/local/share/GeoIP/ for a GeoIP database according to type. PATH Absolute/relative path to GeoIP database. FLAG Flags seperated by ':', eg memory_cache:memory_check COMMAND
Individual singular commands can be one of: close Close the currently open database. db_info Get information about the current database. db_edition Returns edition of opened database. db_avail Test the availability of databases in your system in known locations. e.g db_avail country_edition QUERY
Commands that query the database. All commands return N/A if a result cannot be found. If none already open, a command will attempt to open a suitable database. country commands will open a country_edition database. region commands will open a region_edition_rev1 one. name com- mands will open an org_edition one, and the record_edition will open a city_edition_rev1 database. The commands are: country_code_by_addr Takes an IP address and returns the ISO-3166-1 Alpha-2 code of the country. country_code3_by_addr Takes an IP address and returns the ISO-3166-1 Alpha-3 code the country. country_code_by_name Takes a hostname and returns the ISO-3166-1 Alpha-2 code the country. country_code3_by_name Takes a hostname and returns the ISO-3166-1 Alpha-3 code the country. country_name_by_addr Takes an IP address and returns the country name. country_name_by_name Takes a hostname and returns the country name. name_by_addr Takes an IP address and returns the organisation name (or ISP/ASnum according to the opened database) name_by_name Takes a hostname and returns the organisation name. region_by_addr Takes an IP address and returns these region attributes as in an associative array: country, region region_by_name Takes a hostname and returns the region attributes. record_by_addr Takes an IP address and returns these record attributes as in an associative array: code, code3, region, country, city, postcode, latitude, longitude, dma(dma code), and area (area code) record_by_name Takes a hostname and returns the record attributes. TYPES
Relevant types of databases are: country_edition, org_edition, isp_edition, city_edition_rev1, region_edition_rev1, geoip_asnum_edition. "open -type" will accept their unambiguous abbreviations. FLAGS
Valid flags are: standard, memory_cache, check_cache, index_cache. FILES
./share/GeoIP.dat GeoIP country_edition database. ./share/GeoIPOrg.dat GeoIP org_edition database. ./share/GeoIPCity.dat GeoIP region_city_rev1 database. ./share/GeoIPRegion.dat GeoIP region_edition_rev1 database. ./share/GeoIPASNum.dat GeoIP asnum_edition database. BUGS
Please report to author. AUTHOR
Djihed Afifi <djihed@gmail.com>. SEE ALSO
GeoIP C API documentation <www.maxmind.com> Tcl extension April 2007 geoip(3)
All times are GMT -4. The time now is 02:15 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy