- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Return codes from remote commands
Operating System - Linux
1752821
Members
4396
Online
108789
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
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
тАО09-29-2006 08:14 AM
тАО09-29-2006 08:14 AM
Return codes from remote commands
This should be a simple problem.
I need to test for the existance of a file on a remote host. rsh test -f does not work because not matter what the result of the test command, rsh completes sucussfully ( ie returns 0 ).
I'm checking $?.
Any ideas would be helpful.
I need to test for the existance of a file on a remote host. rsh
I'm checking $?.
Any ideas would be helpful.
Computers are just external storage for my brain.
- Tags:
- remsh
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-29-2006 08:29 AM
тАО09-29-2006 08:29 AM
Re: Return codes from remote commands
Hi Robert:
Write the result of the file test into a *file* that you fetch to retrieve to determine the success or failure.
Regards!
...JRF...
Write the result of the file test into a *file* that you fetch to retrieve to determine the success or failure.
Regards!
...JRF...
- Tags:
- Test
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-29-2006 08:32 AM
тАО09-29-2006 08:32 AM
Re: Return codes from remote commands
How about this:
filespec=/path/to/file
RESULT=`remsh remotehost "ls $filespec" 2>&1`
if [ "$RESULT" = "$filespec" ]
then
#found the file ... do something
else
# nothing found ... do something else
fi
HTH. Good luck
filespec=/path/to/file
RESULT=`remsh remotehost "ls $filespec" 2>&1`
if [ "$RESULT" = "$filespec" ]
then
#found the file ... do something
else
# nothing found ... do something else
fi
HTH. Good luck
nothing wrong with me that a few lines of code cannot fix!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-29-2006 08:52 AM
тАО09-29-2006 08:52 AM
Re: Return codes from remote commands
Wow that was quick.
Kofi ARTHIABAH your solution is a gem.
I was thinking that I would need to do something like what JRF listed, but your solution is the simple one I needed!
Thank you!
Kofi ARTHIABAH your solution is a gem.
I was thinking that I would need to do something like what JRF listed, but your solution is the simple one I needed!
Thank you!
Computers are just external storage for my brain.
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