DSExecute and cd on unix
Moderators: chulett, rschirm, roy
DSExecute and cd on unix
The cd commond does not seem to be effective when I use it.
When i do a pwd it shows the projects directory.
Is there any way I can cd to a given directory and then use unix commands (by using DSExecute) on files in a different path.
When i do a pwd it shows the projects directory.
Is there any way I can cd to a given directory and then use unix commands (by using DSExecute) on files in a different path.
Hello Koojo,
the DSExecute() command will open up a command shell in the current working directory (the project in which your DataStage job is running). Once the command returns back to the DataStage job this shell is closed; so doing a DSExecute() to cd to another directory and then using another DSExecute() will give you the current project directory as the attach point. If you need to execute a series of commands then call up a script from DataStage which then does your other commands.
the DSExecute() command will open up a command shell in the current working directory (the project in which your DataStage job is running). Once the command returns back to the DataStage job this shell is closed; so doing a DSExecute() to cd to another directory and then using another DSExecute() will give you the current project directory as the attach point. If you need to execute a series of commands then call up a script from DataStage which then does your other commands.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
You can string a series of commands together using a semi-colon as a separator. This is normal UNIX stuff.
Etc, etc. Works just fine like this in DSExecute or ExecSH.
Code: Select all
cd /x/y/z; cat dddd
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
Instead of:
You should just do
You should write scripts that can be executed from anywhere and have enough logic to handle not requiring a directory change. Beginner programmers do this, rather than fully qualify all paths. It's rather elegant to set variables to hold directory paths within your script and then just use that variable when constructing a filename.
Code: Select all
cd /here/there/everywhere/scripts
./runmyscript.ksh
Code: Select all
/here/there/everywhere/scripts/runmyscript.ksh
Kenneth Bland
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
Don't forget about "more accurate", either
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
And most of our answers don't end with:
OrYou need to wait for the next version...
OrYou need to upgrade to PX...
We help get it done now, rather than later, if ever.You need to get some help from Professional Services...
Kenneth Bland
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle