- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Rexec command problem
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2005 01:58 AM
05-31-2005 01:58 AM
Rexec command problem
#!/bin/ksh
logfile=send_item_master_to_gemms.log
DX_ITEM_path=/db_spd_sheet/sci/dx
dmp_path=/users/nmxbatch/subrata
remote_path=/home/nmxbatch/subrata
exec $dmp_path/connect_gemp022p $remote_path/load_ITEM_MASTER.sh
echo "Completing loading of DX.ITEM.csv into ITEM_MASTER GEMMS Server" >> ${dmp_path}/$logfile
echo `date` >> ${dmp_path}/$logfile
rcp -p nmxbatch@gemp022p:/home/nmxbatch/subrata/load_DX.ITEM.log /users/nmxbatch/subrata/
echo $dmp_path >>${dmp_path}/$logfile
ls -lrt load_DX.ITEM.log>>${dmp_path}/$logfile
cd $dmp_path
cat load_DX.ITEM.log >>${dmp_path}/$logfile
echo `date` >> ${dmp_path}/$logfile
echo "End of Loading DX.ITEM.csv into ITEM_MASTER GEMMS Server" >> ${dmp_path}/$logfile
and the load_ITEM_MASTER.sh script is attached which is executing on the remote server
#---------------------
Problem is through rexec command i can execute the load_ITEM_MASTER.sh on remote server But after that it is exiting and not able to execute after that rexec comand . Still not able to understand why it is behaving like this .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2005 02:43 AM
05-31-2005 02:43 AM
Re: Rexec command problem
You have an "exec" and not an "rexec"
live free or die
harry d brown jr
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2005 03:17 AM
05-31-2005 03:17 AM
Re: Rexec command problem
and calling the script which is passed as parameter where i have use the rexec command .
#include
#include
#include
#include
#include
#include
char *host[] = { "gemms" };
char *user = "nmxbatch";
char *passwd = "nmxbatch";
char *cmd = "";
/* remsh uamtv005 . .profile 2>&- \; test.prg */
main(argc, argv)
char **argv;
int argc;
{
char ch;
struct servent *servent;
FILE *fp;
int sd;
servent = getservbyname("exec", "tcp");
sd = rexec(host, servent->s_port, user, passwd, argv[1], 0);
fp = fdopen(sd, "r");
while ((ch = getc(fp)) != EOF)
putchar(ch);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2005 03:22 AM
05-31-2005 03:22 AM
Re: Rexec command problem
Need help on this issue as the script is exiting after executing this line
exec $dmp_path/connect_gemp022p $remote_path/load_ITEM_MASTER.sh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2005 05:05 AM
05-31-2005 05:05 AM
Re: Rexec command problem
Will never return to the script that called it and the script that called exec will terminate.
You just need to remove the "exec " from the beginning of that line:
$dmp_path/connect_gemp022p $remote_path/load_ITEM_MASTER.sh
If you want it to run in the background and not wait, then issue:
$dmp_path/connect_gemp022p $remote_path/load_ITEM_MASTER.sh &
or
nohup $dmp_path/connect_gemp022p $remote_path/load_ITEM_MASTER.sh &
live free or die
harry d brown jr
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2005 05:30 AM
06-01-2005 05:30 AM
Re: Rexec command problem
Any idea ...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2005 06:02 AM
06-01-2005 06:02 AM
Re: Rexec command problem
and
identify what you changed?
live free or die
harry d brown jr