10-29-2008
Passing parameter from one file to shell script
Hi All,
I have a 2 files. File1 i am generating using an ETL tool, which is a comman seperated delimited file which contains country code & load date.
everytime, this country code will be updated from a table. It might be AB or BA & ld_date will be for which date we need to load the file.
In file2.sh script which is doing feed validation test for the feed file, i need to pass this country code & load date.
File1
====
COUNTRYCODE,LD_DATE
AB,20081210
File2.sh
======
echo $1 $2
Can someone tell me if it is possible to pass in this manner. Because i need to call File2.sh thru ETL tool. so i cannot manually change the parameter daily. I need to pass this parameter dynamically for each run.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
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
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
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
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
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
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
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
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
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
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
LEARN ABOUT CENTOS
gfs2_tool
gfs2_tool(8) System Manager's Manual gfs2_tool(8)
NAME
gfs2_tool - interface to gfs2 ioctl/sysfs calls
SYNOPSIS
gfs2_tool COMMAND [OPTION]...
DESCRIPTION
gfs2_tool is an interface to a variety of the GFS2 ioctl/sysfs calls. Some of the functions of gfs_tool have been replaced by standard sys-
tem tools such as mount and chattr, so gfs2_tool doesn't have as many options as gfs_tool used to.
COMMANDS
clearflag Flag File1 File2 ...
Clear an attribute flag on a file. This is now obsolete and kept only for backward compatibility, chattr is the preferred way to
clear attribute flags. See setflag for available flags. This option will probably be removed at a future date.
freeze MountPoint
Freeze (quiesce) a GFS2 cluster.
gettune MountPoint
Print out the current values of the tuning parameters in a running filesystem. A better source of similar (more comprehensive)
information is that in the /proc/mounts file. Running the mount command with no arguments will also provide the same information.
This option is considered obsolete and will probably be removed at some future date.
journals MountPoint
Print out information about the journals in a mounted filesystem.
lockdump MountPoint
Print out information about the locks this machine holds for a given filesystem. This information is also available via the debugfs
glock dump file, and accessing that file is the preferred method of obtaining a dump of the glock state.
sb device proto [newvalue]
View (and possibly replace) the name of the locking protocol in the file system superblock. The file system shouldn't be mounted by
any client when you do this.
sb device table [newvalue]
View (and possibly replace) the name of the locking table in the file system superblock. The file system shouldn't be mounted by
any client when you do this.
sb device ondisk [newvalue]
View (and possibly replace) the ondisk format number in the file system superblock. The file system shouldn't be mounted by any
client when you do this. No one should have to use this.
sb device multihost [newvalue]
View (and possibly replace) the multihost format number in the file system superblock. The file system shouldn't be mounted by any
client when you do this. No one should have to use this.
sb device uuid [newvalue]
View (and possibly replace) the uuid in the file system superblock. The file system shouldn't be mounted by any client when you do
this. The new uuid value should be in the standard uuid format. For example: 1AEA8269-15C5-72BD-6D83-8720B17AA4EE
sb device all
Print out the superblock.
setflag Flag File1 File2 ...
Set an attribute flag on a file. The currently supported flags are jdata, immutable, appendonly, noatime, and sync. The chattr
command is the preferred way to set attributes on files. This option will probably be removed at a future date.
The jdata flag causes all the data written to a file to be journaled. If the jdata flag is set for a directory, all files and
directories subsequently created within that directory are also journaled. This behavior replaces the old inherit_jdata flag from
gfs. Same as chattr +j.
The immutable flag marks the file immutable. The behavior is similar to the immutable flag in the ext2/3 filesystems. All write
access is denied. Same as chattr +i.
The appendonly flag causes all data to be written at the end of the file. Same as chattr +a.
The noatime flag disables updates to the file's access time. Same as chattr +A.
The sync flag causes data written to the file to be sync'ed to stable storage immediately. Same as chattr +S.
settune MountPoint parameter newvalue
Set the value of tuning parameter. Use gettune for a listing of tunable parameters. The mount -oremount command is the preferred
way to set the values of tunable parameters. At some future stage, when all parameters can be set via mount, this option will be
removed.
unfreeze MountPoint
Unfreeze a GFS2 cluster.
version
Print out the version of GFS2 that this program goes with.
withdraw MountPoint
Cause GFS2 to abnormally shutdown a given filesystem on this node. This feature is only useful for testing and should not be used
during normal filesystem operation.
gfs2_tool(8)