Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 971
  • Last Modified:

calling sh script from putty

I have below export.sh script how can i call this sh from putty

content is below

i tried sh export.sh it just sits there no results never asked me for parms

# exports data into IXF file.
# gets password from filename (parm 2 )
# which resides in DATA_DIR (parm 1 )

. /db2_aa

cd ${1}

pswd_file=${2} ; export pswd_file

pswd=`cat  ${pswd_file}`   ; rm ${pswd_file}
export pswd

db2 connect to aa user bb using ${pswd};
db2 export to abc.ixf of ixf  select processkey, lastprocesstime from aa  where 1=1  with ur ;
db2 connect reset
  • 2
1 Solution
try to run it with

sh -x  export.sh

and see where it stuck
The script is expecting 2 parameters

1 - directory
2 - password file

You should call it with

./export.sh /some/directory /some/password.file
sam2929Author Commented:
Below script  works perfect but i want to do some changes
1) using abc  second line is password i want to encrypt it and call it as parameter
2) "/opt/aa/ third and fourth line i want this call in parms too

How can i convert this script to parameters and also what will execute command to call

# exports data into IXF file.

. /db2_src/db2rind/sqllib/db2profile

db2 connect to autod user mkt_dbo using abc;
db2 EXPORT TO "/opt/aa/abc.ixf"
 OF DEL MESSAGES " /opt/aa/abcerror.txt"
 SELECT aa FROM aa.kk where 1=1  with ur;
db2 connect reset
sam2929Author Commented:
any suggestions please

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now