calling sh script from putty

Posted on 2012-08-11
Last Modified: 2012-08-14
I have below script how can i call this sh from putty

content is below

i tried 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
Question by:sam2929
    LVL 40

    Expert Comment

    try to run it with

    sh -x

    and see where it stuck
    LVL 48

    Accepted Solution

    The script is expecting 2 parameters

    1 - directory
    2 - password file

    You should call it with

    ./ /some/directory /some/password.file

    Author Comment

    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

    Author Comment

    any suggestions please

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    Java performance on Solaris - Managing CPUs There are various resource controls in operating system which directly/indirectly influence the performance of application. one of the most important resource controls is "CPU".   In a multithreaded…
    Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
    Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
    Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

    730 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now