- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- ux shell and c language
Operating System - HP-UX
1753518
Members
5212
Online
108795
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
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
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- 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
тАО10-28-2004 10:22 PM
тАО10-28-2004 10:22 PM
Hi,
I need to kill a process owned by user1 from a user2.
The user2 access shell of user1 via a remote shell invoked by a c routine.
The problem is that the c routine does not see the variable "pidtokill".
Ho make this work ?
Many thanks
Angelo
#include
#include
#include
int pidtokill ;
main ()
{
printf ( "pid to killi ==> ");
scanf ("%d",&pidtokill);
system(
"remsh machine1 -l user1 \" kill &pidtokill \"" );
}
I need to kill a process owned by user1 from a user2.
The user2 access shell of user1 via a remote shell invoked by a c routine.
The problem is that the c routine does not see the variable "pidtokill".
Ho make this work ?
Many thanks
Angelo
#include
#include
#include
int pidtokill ;
main ()
{
printf ( "pid to killi ==> ");
scanf ("%d",&pidtokill);
system(
"remsh machine1 -l user1 \" kill &pidtokill \"" );
}
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-28-2004 10:37 PM
тАО10-28-2004 10:37 PM
Solution
This should achieve what you're trying: -
#include
#include
#include
int pidtokill ;
char command[256];
main()
{
printf ( "pid to killi ==> ");
scanf ("%d",&pidtokill);
sprintf (&command,"remsh machine1 -l user1 \"kill %d\"",pidtokill);
system(command);
}
#include
#include
#include
int pidtokill ;
char command[256];
main()
{
printf ( "pid to killi ==> ");
scanf ("%d",&pidtokill);
sprintf (&command,"remsh machine1 -l user1 \"kill %d\"",pidtokill);
system(command);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-29-2004 12:36 AM
тАО10-29-2004 12:36 AM
Re: ux shell and c language
Hi,
the result has been:
cc: "diespool2.c", line 12: warning 604: Pointers are not assignment-compatible.
cc: "diespool2.c", line 12: warning 563: Argument #1 is not the correct type.
Actually I am reading sprintf man page but cannot really understand where the error is.
Thanks for help
Thanks
Angelo
the result has been:
cc: "diespool2.c", line 12: warning 604: Pointers are not assignment-compatible.
cc: "diespool2.c", line 12: warning 563: Argument #1 is not the correct type.
Actually I am reading sprintf man page but cannot really understand where the error is.
Thanks for help
Thanks
Angelo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-29-2004 01:40 AM
тАО10-29-2004 01:40 AM
Re: ux shell and c language
Hi,
&command was an error.
Eliminating the & the job works
Problem fixed
Thanks
Angelo
&command was an error.
Eliminating the & the job works
Problem fixed
Thanks
Angelo
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP