Hi all,
I wrote a shell script File_Rename.sh in a folder say /data/customer/Personal/Prashanth/
Now I want to call that shell script in Execute Command Activity in Job Sequence. There were no parameters for that shell script. When I executed in Unix at command prompt as sh File_Rename.sh , it executed perfectly. But in Execute Command Activity, I have given the command as
/data/name/sh File_Rename.sh and no parameters as my shell script doesn't need any one. When I ran the job, it is giving the following errors.
samplejob..JobControl (@Execute_Command_0): Executed: /data/customer/Personal/Prashanth/sh File_Rename.sh
Reply=127
Output from command ====>
SH: /data/customer/Personal/Prashanth/sh: not found.
samplejob..JobControl (@Execute_Command_0): Command /data/customer/Personal/Prashanth/sh did not finish OK, reply = '127'
samplejob..JobControl (@Execute_Command_0): Command /data/customer/Personal/Prashanth/sh File_Rename.sh did not finish OK, reply = '127'
samplejob..JobControl (@Execute_Command_0): Controller problem: Unhandled failure (127) encountered executing command /data/customer/Personal/Prashanth/sh File_Rename.sh
samplejob..JobControl (fatal error from @Coordinator): Sequence job (restartable) will abort due to previous unrecoverable errors
Can some one guide me in this regard please. Its very urgent.
Problem resolved
Moderators: chulett, rschirm, roy
Problem resolved
Last edited by kumar on Mon Dec 12, 2005 1:52 am, edited 2 times in total.
VARUNKUMAR
Re: Calling shell scripts in Execute Command Activity. Urgen
We're sorry your problems are urgent. Please don't ask for urgent answers again in the future, as that usually means they won't be answered immediately.kumar wrote:Can some one guide me in this regard please. Its very urgent.
Your problem is that you lack the understanding of how unix command line works. This is not a problem that will be fixed "urgently". Giving you the immediate answer means that you will fail to learn what you need to know, which is how commands are run from the command line.
"sh" is the Bourne shell command interpreter program. It does not exist in your supplied directory, it is in the /usr/bin directory. Trying to run "sh" from another directory will not work.
Your script exists in your directory, therefore, you need to supply the full path to that directory as part of the command invocation. Since you are required to run as a Bourne shell, you're invoking your script using "sh" and need to give the script as a command line option to the "sh" program.
Since /usr/bin is probably already in the executable search path (see env|grep PATH to confirm your user path) you don't need to qualify the "sh" with /usr/bin. So, a simple
Code: Select all
sh /data/customer/Personal/Prashanth/File_Rename.sh
I suspect your File_Rename.sh script will also have execution issues, since it will be invoked from the CWD, which is the current working directory and in the case of DS is the project directory. I further suspect that your script is doing file level manipulation, which if it assumes it's executing in the /data/customer/Personal/Prashanth directory, means that it attempt to manipulate non-existent files. Your script probably, and stress this HIGHLY, should be passed an argument that indicates the directory where it will find the files for manipulation. This means that the script will be able to find the files it needs, rather than rely on CWD being what you need.
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
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
I worked on that and executed perfetly before I got your answers.
A little bit confused with the way to use the shell script as that is my first assignment on using shell in DS.
I want to ftp multiple files from a remore directory using FTP Enterprise stage . I have tried with many options. It is asking for port number in URI path . Can someone guide me how to give exactly the URI and files .
Some info: My server 10.125.46.152
file path--/data/vsn/
I want to ftp all files in vsn directory .
A little bit confused with the way to use the shell script as that is my first assignment on using shell in DS.
I want to ftp multiple files from a remore directory using FTP Enterprise stage . I have tried with many options. It is asking for port number in URI path . Can someone guide me how to give exactly the URI and files .
Some info: My server 10.125.46.152
file path--/data/vsn/
I want to ftp all files in vsn directory .
VARUNKUMAR