AIX

AIX

Connect with fellow AIX users and experts to gain knowledge, share insights, and solve problems.


#Power
 View Only
Expand all | Collapse all

Importing a secondary shell script into the executing script

  • 1.  Importing a secondary shell script into the executing script

    Posted Fri November 10, 2006 08:44 AM

    Originally posted by: SystemAdmin


    I HAVE TRIED EXECUTING A SCRIPT WITHIN WHICH IT TRIES TO EXECUTE A SECONDARY SCRIPT CONSIDERING BOTH THE SHELL SCRIPTS ARE RESIDING IN THE SAME DIRECTORY(=code/compass/dir/script[/code]).

    SO I HAVE TRIED TO EXECUTE THE PRIMARY SCRIPT AS:

    codesh ./Primary.sh[/code]

    THE SNIPPET(I AM INTERESTED IN) WITHIN THE SHELL SCRIPT IS PLACED HERE:
    code
    1. Include the Utility script for the required functions
    utilDir=/compass/dir/script [i]---- LINE 6[/i]
    . $utilDir/secondary.sh [i]---- LINE 7[/i]
    . $utilDir/secondary1.sh [i]---- LINE 8[/i]
    [/code]

    BUT WHEN EXECUTED THE FOLLOWING LOG IS GENERATED:
    code
    ./Primary.sh[7]: pts: not found.
    ./Primary.sh[8]: pts: not found.
    [/code]
    PLEASE ADVICE WHETHER THIS IS A SYNTACTICAL ERROR OR OTHERWISE.
    #AIX-Forum


  • 2.  Re: Importing a secondary shell script into the executing script

    Posted Fri November 10, 2006 09:38 AM

    Originally posted by: SystemAdmin


    What is the current working directory at the point your script is trying to "include" the secondary script. The syntax "./scriptname" means find the file in the current working directory. Perhaps you're not in the directory you expect. You could debug this by echoing the value of `pwd`.

    HTH

    Jim Lane
    #AIX-Forum